Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/utils: remove deprecated command line flags #22263

Merged
merged 5 commits into from
Feb 24, 2021

Conversation

renaynay
Copy link
Contributor

@renaynay renaynay commented Feb 4, 2021

Resolves #22141

TODO:

  • make sure puppeth is unaffected
  • update docs
  • deprecate May 2020 aliased flags

@renaynay renaynay force-pushed the remove_deprecated_CLI_flags branch 3 times, most recently from 36d16c4 to c3b717b Compare February 8, 2021 12:36
@renaynay renaynay marked this pull request as ready for review February 8, 2021 12:38
@renaynay renaynay requested a review from fjl February 8, 2021 12:38
cmd/geth/consolecmd.go Outdated Show resolved Hide resolved
cmd/utils/flags.go Outdated Show resolved Hide resolved
@renaynay
Copy link
Contributor Author

leave rpc flags for now, keep it deprecated for a couple months (until June 2021), add that to warn log

@fjl
Copy link
Contributor

fjl commented Feb 23, 2021

Everything OK, but we decided to keep --rpc* flags a bit longer.

@fjl
Copy link
Contributor

fjl commented Feb 23, 2021

lint failed, please fix it

@fjl fjl added this to the 1.10.0 milestone Feb 23, 2021
@fjl fjl removed the status:triage label Feb 23, 2021
@fjl fjl merged commit 8e547ee into ethereum:master Feb 24, 2021
meowsbits added a commit to etclabscore/ethereum.go-ethereum that referenced this pull request Mar 8, 2021
Corresponding CLI flags --rpc have been moved to --http.

This moves the admin module HTTP RPC start/stop
methods to an equivalent namespace.

Rel ethereum#22263

Date: 2021-03-08 08:00:11-06:00
Signed-off-by: meows <b5c6@protonmail.com>
karalabe pushed a commit that referenced this pull request Mar 23, 2021
…22461)

* internal/web3ext,node: migrate node admin API (Start|Stop)RPC->HTTP

Corresponding CLI flags --rpc have been moved to --http.

This moves the admin module HTTP RPC start/stop
methods to an equivalent namespace.

Rel #22263

Date: 2021-03-08 08:00:11-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* internal/web3ext: fix startRPC/HTTP param count (4->5)

Date: 2021-03-16 06:13:23-05:00
Signed-off-by: meows <b5c6@protonmail.com>
rauljordan added a commit to prysmaticlabs/bazel-go-ethereum that referenced this pull request Apr 19, 2021
* les: don't drop sentTo for normal cases (#22048)

* eth/protocols/eth: fix slice resize flaw (#22181)

* les: remove useless protocol defines (#22115)

This PR has two changes in the les protocol:

- the auxRoot is not supported. See ethereum/devp2p#171 for more information
- the empty response will be returned in GetHelperTrieProofsMsg request if the merkle
   proving is failed. note, for backward compatibility, the empty merkle proof as well as
   the request auxiliary data will still be returned in  les2/3 protocol no matter the proving
   is successful or not. the proving failure can happen e.g. request the proving for a
   non-included entry in helper trie (unstable header).

* tests/fuzzers/abi: better test generation (#22158)

* tests/fuzzers/abi: better test generation

* tests/fuzzers/abi: fixed packing issue

* oss-fuzz: enable abi fuzzer

* cmd/geth: dump config for metrics (#22083)

* cmd/geth: dump config

* cmd/geth: dump config

* cmd/geth: properly read config again

* cmd/geth: override metrics if flags are set

* cmd/geth: write metrics regardless if enabled

* cmd/geth: renamed to metricsfromcliargs

* metrics: add default configuration

* core/state/snapshot: write snapshot generator in batch (#22163)

* core/state/snapshot: write snapshot generator in batch

* core: refactor the tests

* core: update tests

* core: update tests

* cmd/geth: graceful shutdown if disk is full (#22103)

Adding warnings of free disk space left and graceful shutdown when there is not enough space left.
This also adds a flag datadir.minfreedisk which can be used to set the trigger for low disk space, and setting it to zero disables the check. 

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>

* eth, les: add new config field SyncFromCheckpoint (#22123)

This PR introduces a new config field SyncFromCheckpoint for light client.

In some special scenarios, it's required to start synchronization from some
arbitrary checkpoint or even from the scratch. So this PR offers this
flexibility to users so that the synchronization start point can be configured.

There are two relevant configs: SyncFromCheckpoint and Checkpoint.

- If the SyncFromCheckpoint is true, the light client will try to sync from the
  specified checkpoint.

- If the Checkpoint is not configured, then the light client will sync from the
  scratch(from the latest header if the database is not empty)

Additional notes: these two configs are not visible in the CLI flags but only
accessable in the config file.

Example Usage:

[Eth]
SyncFromCheckpoint = true

[Eth.Checkpoint]
SectionIndex = 100
SectionHead = "0xabc"
CHTRoot = "0xabc"
BloomRoot = "0xabc"

PS. Historical checkpoint can be retrieved from the synced full node or light
client via les_getCheckpoint API.

* oss-fuzz: fix abi fuzzer (#22199)

* go.mod: upgrade golang-lru (#22134)

* downloader: extract findAncestor search functions (#21744)

This is a simple refactoring, extracting common ancestor
negotiation logic to named function

* core: implement background trie prefetcher

Squashed from the following commits:

core/state: lazily init snapshot storage map
core/state: fix flawed meter on storage reads
core/state: make statedb/stateobjects reuse a hasher
core/blockchain, core/state: implement new trie prefetcher
core: make trie prefetcher deliver tries to statedb
core/state: refactor trie_prefetcher, export storage tries
blockchain: re-enable the next-block-prefetcher
state: remove panics in trie prefetcher
core/state/trie_prefetcher: address some review concerns

sq

* core/state: convert prefetcher to concurrent per-trie loader

* eth/filters: fix potential deadlock in filter timeout loop (#22178)

This fixes #22131 and adds a test reproducing the issue.

* event: add ResubscribeErr (#22191)

This adds a way to get the error of the failing subscription
for logging/debugging purposes.

Co-authored-by: Felix Lange <fjl@twurst.com>

* trie: fix range prover (#22210)

Fixes a special case when the trie only has a single trie node and the range proof only contains a single element.

* common/mclock: remove dependency on github.com/aristanetworks/goarista (#22211)

It takes three lines of code to get to runtime.nanotime, no need to
pull a dependency for that.

* cmd, geth: CLI help fixes (#22220)

* cmd, geth: Reflect command being optional - closes 22218

* cmd, geth: Set current year to 2021

* cmd, geth: CLI help fixes (#22220)

* cmd, geth: Reflect command being optional - closes 22218

* cmd, geth: Set current year to 2021

* eth/protocols/snap: snap sync testing (#22179)

* eth/protocols/snap: make timeout configurable

* eth/protocols/snap: snap sync testing

* eth/protocols/snap: test to trigger panic

* eth/protocols/snap: fix race condition on timeouts

* eth/protocols/snap: return error on cancelled sync

* squashme: updates + test causing panic + properly serve accounts in order

* eth/protocols/snap: revert failing storage response

* eth/protocols/snap: revert on bad responses (storage, code)

* eth/protocols/snap: fix account handling stall

* eth/protocols/snap: fix remaining revertal-issues

* eth/protocols/snap: timeouthandler for bytecode requests

* eth/protocols/snap: debugging + fix log message

* eth/protocols/snap: fix misspelliings in docs

* eth/protocols/snap: fix race in bytecode handling

* eth/protocols/snap: undo deduplication of storage roots

* synctests: refactor + minify panic testcase

* eth/protocols/snap: minor polishes

* eth: minor polishes to make logs more useful

* eth/protocols/snap: remove excessive logs from the test runs

* eth/protocols/snap: stress tests with concurrency

* eth/protocols/snap: further fixes to test cancel channel handling

* eth/protocols/snap: extend test timeouts on CI

Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* go.mod: update dependencies (#22216)

This updates go module dependencies as discussed in #22050.

* graphql: change receipt status to decimal instead of hex (#22187)

This PR fixes the receipt status field to be decimal instead of a hex string,
as called for by the spec.

Co-authored-by: Martin Holst Swende <martin@swende.se>

* go.mod: upgrade github.com/huin/goupnp (#22227)

This updates the goupnp dependency, fixing huin/goupnp#33

* snapshot: merge loops for better performance (#22160)

* core: reset to genesis when middle block is missing (#22135)

When a sethead/rewind finds that the targeted block is missing, it resets to genesis instead of crashing. Closes #22129

* eth/tracers: move tracing APIs into eth/tracers (#22161)

This moves the tracing RPC API implementation to package eth/tracers.
By doing so, package eth no longer depends on tracing and the duktape JS engine.

The change also enables tracing using the light client. All tracing methods work with the
light client, but it's a lot slower compared to using a full node.

* eth, p2p: reserve half peer slots for snap peers during snap sync (#22171)

* eth, p2p: reserve half peer slots for snap peers during snap sync

* eth: less logging

* eth: rework the eth/snap peer reservation logic

* eth: rework the eth/snap peer reservation logic (again)

* tests/fuzzers/abi: fixed one-off panic with int.Min64 value (#22233)

* tests/fuzzers/abi: fixed one-off panic with int.Min64 value

* tests/fuzzers/abi: fixed one-off panic with int.Min64 value

* internal/ethapi: print tx details when submitting (#22170)

This adds more info about submitted transactions in log messages.

Co-authored-by: Felix Lange <fjl@twurst.com>

* core/state: fix panic in state dumping (#22225)

* core: speed up header import (#21967)

This PR implements the following modifications

- Don't shortcut check if block is present, thus avoid disk lookup
- Don't check hash ancestry in early-check (it's still done in parallel checker)
- Don't check time.Now for every single header

Charts and background info can be found here: https://github.com/holiman/headerimport/blob/main/README.md
With these changes, writing 1M headers goes down to from 80s to 62s.

* accounts/scwallet: use go-ethereum crypto instead of go-ecdh (#22212)

* accounts/scwallet: use go-ethereum crypto instead of go-ecdh

github.com/wsddn/go-ecdh is a wrapper package for ECDH functionality
with any elliptic curve.

Since 'generic' ECDH is not required in accounts/scwallet (the curve is
always secp256k1), we can just use the standard library functionality
and our own crypto libraries to perform ECDH and save a dependency.

* Update accounts/scwallet/securechannel.go

Co-authored-by: Guillaume Ballet <gballet@gmail.com>

* Use the correct key

Co-authored-by: Guillaume Ballet <gballet@gmail.com>

* accounts/scwallet: update documentation (#22242)

* les: switch to new discv5 (#21940)

This PR enables running the new discv5 protocol in both LES client
and server mode. In client mode it mixes discv5 and dnsdisc iterators
(if both are enabled) and filters incoming ENRs for "les" tag and fork ID.
The old p2p/discv5 package and all references to it are removed.

Co-authored-by: Felix Lange <fjl@twurst.com>

* rpc: deprecate Client.ShhSubscribe (#22239)

It never worked, whisper uses polling.

Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd,core,eth,params,tests: define yolov3 + enable EIP-2565 (#22213)

Removes the yolov2 definition, adds yolov3, including EIP-2565. This PR also disables some of the erroneously generated blockchain and statetests, and adds the new genesis hash + alloc for yolov3. 
This PR disables the CLI switches for yolo, since it's not complete until we merge support for 2930.

* les/utils: UDP rate limiter (#21930)

* les/utils: Limiter

* les/utils: dropped prior weight vs variable cost logic, using fixed weights

* les/utils: always create node selector in addressGroup

* les/utils: renamed request weight to request cost

* les/utils: simplified and improved the DoS penalty mechanism

* les/utils: minor fixes

* les/utils: made selection weight calculation nicer

* les/utils: fixed linter warning

* les/utils: more precise and reliable probabilistic test

* les/utils: fixed linter warning

* cmd/clef: don't check file permissions on windows (#22251)

Fixes #20123

* eth/tracers: fix unigram tracer (#22248)

* eth: check snap satelliteness, delegate drop to eth (#22235)

* eth: check snap satelliteness, delegate drop to eth

* eth: better handle eth/snap satellite relation, merge reg/unreg paths

* cmd/geth, node: allow configuring JSON-RPC on custom path prefix (#22184)

This change allows users to set a custom path prefix on which to mount the http-rpc
or ws-rpc handlers via the new flags --http.rpcprefix and --ws.rpcprefix.

Fixes #21826

Co-authored-by: Felix Lange <fjl@twurst.com>

* all: remove unneeded parentheses (#21921)

* remove uneeded convertion type

* remove redundant type in composite literal

* omit explicit type where implicit

* remove unused redundant parenthesis

* remove redundant import alias duktape

* trie : use trie.NewStackTrie instead of new(trie.Trie) (#22246)

The PR makes use of the stacktrie, which is is more lenient on resource consumption, than the regular trie, in cases where we only need it for DeriveSha

* core: reset txpool state on sethead (#22247)

fixes an issue where local transactions that were included in the chain before a SetHead were rejected if resubmitted, since the txpool had not reset the state to the current (older) state.

* fuzzers: added consensys/gurvy library to bn256 differential fuzzer (#21812)

This pr adds consensys' gurvy bn256 variant into the code for differential fuzzing.

* internal/ethapi: comment nitpick (#22270)

* eth: move eth.Config to a common package (#22205)

This moves the eth config definition into a separate package, eth/ethconfig. 
Packages eth and les can now import this common package instead of
importing eth from les, reducing dependencies.

Co-authored-by: Felix Lange <fjl@twurst.com>

* internal/ethapi: fix typo in comment (#22271)

* eth: don't wait for snap registration if we're not running snap (#22272)

Prevents a situation where we (not running snap) connects with a peer running snap, and get stalled waiting for snap registration to succeed (which will never happen), which cause a waitgroup wait to halt shutdown

* consensus: remove seal verification from the consensus engine interface (#22274)

* cmd/utils: enable snapshots by default

* metrics: fix cast omission in cpu_syscall.go (#22262)

fixes an regression which caused build failure on certain platforms

* params: just to make snapshots a bit more official

* all: bloom-filter based pruning mechanism (#21724)

* cmd, core, tests: initial state pruner

core: fix db inspector

cmd/geth: add verify-state

cmd/geth: add verification tool

core/rawdb: implement flatdb

cmd, core: fix rebase

core/state: use new contract code layout

core/state/pruner: avoid deleting genesis state

cmd/geth: add helper function

core, cmd: fix extract genesis

core: minor fixes

contracts: remove useless

core/state/snapshot: plugin stacktrie

core: polish

core/state/snapshot: iterate storage concurrently

core/state/snapshot: fix iteration

core: add comments

core/state/snapshot: polish code

core/state: polish

core/state/snapshot: rebase

core/rawdb: add comments

core/rawdb: fix tests

core/rawdb: improve tests

core/state/snapshot: fix concurrent iteration

core/state: run pruning during the recovery

core, trie: implement martin's idea

core, eth: delete flatdb and polish pruner

trie: fix import

core/state/pruner: add log

core/state/pruner: fix issues

core/state/pruner: don't read back

core/state/pruner: fix contract code write

core/state/pruner: check root node presence

cmd, core: polish log

core/state: use HEAD-127 as the target

core/state/snapshot: improve tests

cmd/geth: fix verification tool

cmd/geth: use HEAD as the verification default target

all: replace the bloomfilter with martin's fork

cmd, core: polish code

core, cmd: forcibly delete state root

core/state/pruner: add hash64

core/state/pruner: fix blacklist

core/state: remove blacklist

cmd, core: delete trie clean cache before pruning

cmd, core: fix lint

cmd, core: fix rebase

core/state: fix the special case for clique networks

core/state/snapshot: remove useless code

core/state/pruner: capping the snapshot after pruning

cmd, core, eth: fixes

core/rawdb: update db inspector

cmd/geth: polish code

core/state/pruner: fsync bloom filter

cmd, core: print warning log

core/state/pruner: adjust the parameters for bloom filter

cmd, core: create the bloom filter by size

core: polish

core/state/pruner: sanitize invalid bloomfilter size

cmd: address comments

cmd/geth: address comments

cmd/geth: address comment

core/state/pruner: address comments

core/state/pruner: rename homedir to datadir

cmd, core: address comments

core/state/pruner: address comment

core/state: address comments

core, cmd, tests: address comments

core: address comments

core/state/pruner: release the iterator after each commit

core/state/pruner: improve pruner

cmd, core: adjust bloom paramters

core/state/pruner: fix lint

core/state/pruner: fix tests

core: fix rebase

core/state/pruner: remove atomic rename

core/state/pruner: address comments

all: run go mod tidy

core/state/pruner: avoid false-positive for the middle state roots

core/state/pruner: add checks for middle roots

cmd/geth: replace crit with error

* core/state/pruner: fix lint

* core: drop legacy bloom filter

* core/state/snapshot: improve pruner

* core/state/snapshot: polish concurrent logs to report ETA vs. hashes

* core/state/pruner: add progress report for pruning and compaction too

* core: fix snapshot test API

* core/state: fix some pruning logs

* core/state/pruner: support recovering from bloom flush fail

Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* core/state/pruner: fix compaction after pruning

* core/state/pruner: fix compaction range error

* internal/debug: add switch to format logs with json (#22207)

adds a flag --log.json which if enabled makes the client format logs with JSON.

* accounts/abi/bind: fixed unpacking error (#22230)

There was a dormant error with structured inputs that failed unpacking.
This commit fixes the error by switching casting to the better abi.ConvertType function.
It also adds a test for calling a view function that returns a struct

* cmd/utils, eth/ethconfig: unindex txs older than ~1 year

* cmd/devp2p: fix documentation for eth-test (#22298)

* core: fix temp memory blowup caused by defers holding on to state

* les: enable les/4 and add tests (#22321)

* cmd/utils: add workaround for FreeBSD statfs quirk (#22310)

Make geth build on FreeBSD, fixes #22309.

* cmd/geth: fix js unclean shutdown (#22302)

* trie: fix bloom crash on fast sync restart

* rpc: increase the number of subscriptions in storm test (#22316)

* core/state/snapshot: ensure Cap retains a min number of layers

* eth: fix snap sync cancellation

* cmd/devp2p/internal/ethtest: use shared message types (#22315)

This updates the eth protocol test suite to use the message type
definitions of the 'production' protocol implementation in eth/protocols/eth.

* eth/handler, broadcast: optimize tx broadcast mechanism (#22176)

This PR optimizes the broadcast loop. Instead of iterating twice through a given set of transactions to weed out which peers have and which do not have a tx, to send/announce transactions, we do it only once.

* core/state: copy the snap when copying the state (#22340)

* core/state: copy the snap when copying the state

* core/state: deep-copy snap stuff during state Copy

* rlp: handle case of normal EOF in Stream.readFull (#22336)

io.Reader may return n > 0 and io.EOF at the end of the input stream.
readFull did not handle this correctly, looking only at the error. This fixes
it to check for n == len(buf) as well.

* node: always show websocket url in logs (#22307)

* eth: implement eth66 (#22241)

* eth/protocols/eth: split up the eth protocol handlers

* eth/protocols/eth: define eth-66 protocol messages

* eth/protocols/eth: poc implement getblockheaders on eth/66

* eth/protocols/eth: implement remaining eth-66 handlers

* eth/protocols: define handler map for eth 66

* eth/downloader: use protocol constants from eth package

* eth/protocols/eth: add ETH66 capability

* eth/downloader: tests for eth66

* eth/downloader: fix error in tests

* eth/protocols/eth: use eth66 for outgoing requests

* eth/protocols/eth: remove unused error type

* eth/protocols/eth: define protocol length

* eth/protocols/eth: fix pooled tx over eth66

* protocols/eth/handlers: revert behavioural change which caused tests to fail

* eth/downloader: fix failing test

* eth/protocols/eth: add testcases + fix flaw with header requests

* eth/protocols: change comments

* eth/protocols/eth: review fixes + fixed flaw in RequestOneHeader

* eth/protocols: documentation

* eth/protocols/eth: review concerns about types

* p2p/dnsdisc: fix hot-spin when all trees are empty (#22313)

In the random sync algorithm used by the DNS node iterator, we first pick a random
tree and then perform one sync action on that tree. This happens in a loop until any
node is found. If no trees contain any nodes, the iterator will enter a hot loop spinning
at 100% CPU.

The fix is complicated. The iterator now checks if a meaningful sync action can
be performed on any tree. If there is nothing to do, it waits for the next root record
recheck time to arrive and then tries again.

Fixes #22306

* les: renamed lespay to vflux (#22347)

* cmd/utils: disable caching preimages by default

* travis, appveyor, build: bump Go to 1.16

* les: fix balance expiration (#22343)

* les/lespay/server: fix balance expiration and add test

* les: move client balances to a new db

* les: rename lespayDb to lesDb

* tests/fuzzers/les: add fuzzer for les server handler (#22282)

* les: refactored server handler

* tests/fuzzers/les: add fuzzer for les server handler

* tests, les: update les fuzzer

tests: update les fuzzer

tests/fuzzer/les: release resources

tests/fuzzer/les: pre-initialize all resources

* les: refactored server handler and fuzzer

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* les: clean up server handler (#22357)

* cmd/geth: add db commands stats, compact, put, get, delete (#22014)

This PR introduces:

- db.put to put a value into the database
- db.get to read a value from the database
- db.delete to delete a value from the database
- db.stats to check compaction info from the database
- db.compact to trigger a db compaction

It also moves inspectdb to db.inspect.

* internal/ethapi: reject non-replay-protected txs over RPC (#22339)

This PR prevents users from submitting transactions without EIP-155 enabled. This behaviour can be overridden by specifying the flag --rpc.allow-unprotected-txs=true.

* accounts/abi/bind: fix up Go mod files for Go 1.16

* Dockerfile: bump to Go 1.16 base images

* travis: bump Android NDK version

* travis: bump builders to Bionic

* travis: manually install Android since Travis is stale (#22373)

* cmd/utils: remove deprecated command line flags (#22263)

This removes support for all deprecated flags except --rpc*.

* eth/protocols/snap: lower abortion and resumption logs to debug

* cmd, eth, les: enable serving light clients when non-synced (#22250)

This PR adds a more CLI flag, so that the les-server can serve light clients even the local node is not synced yet.

This functionality is needed in some testing environments(e.g. hive). After launching the les server, no more blocks will be imported so the node is always marked as "non-synced".

* les, light: improve txstatus retrieval (#22349)

Transaction unindexing will be enabled by default as of 1.10, which causes tx status retrieval will be broken without this PR. 

This PR introduces a retry mechanism in TxStatus retrieval.

* all: add support for EIP-2718, EIP-2930 transactions (#21502)

This adds support for EIP-2718 typed transactions as well as EIP-2930
access list transactions (tx type 1). These EIPs are scheduled for the
Berlin fork.

There very few changes to existing APIs in core/types, and several new APIs
to deal with access list transactions. In particular, there are two new
constructor functions for transactions: types.NewTx and types.SignNewTx.
Since the canonical encoding of typed transactions is not RLP-compatible,
Transaction now has new methods for encoding and decoding: MarshalBinary
and UnmarshalBinary.

The existing EIP-155 signer does not support the new transaction types.
All code dealing with transaction signatures should be updated to use the
newer EIP-2930 signer. To make this easier for future updates, we have
added new constructor functions for types.Signer: types.LatestSigner and
types.LatestSignerForChainID. 

This change also adds support for the YoloV3 testnet.

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* cmd/devp2p: add eth66 test suite (#22363)

Co-authored-by: Martin Holst Swende <martin@swende.se>

* les: move server pool to les/vflux/client (#22377)

* les: move serverPool to les/vflux/client

* les: add metrics

* les: moved ValueTracker inside ServerPool

* les: protect against node registration before server pool is started

* les/vflux/client: fixed tests

* les: make peer registration safe

* all: define Berlin hard fork spec

* rpc: add separate size limit for websocket (#22385)

This makes the WebSocket message size limit independent of the
limit used for HTTP requests. The new limit for WebSocket messages 
is 15MB.

* accounts/keystore: use github.com/google/uuid (#22217)

This replaces the github.com/pborman/uuid dependency with
github.com/google/uuid because the former is only a wrapper for
the latter (since v1.0.0).

Co-authored-by: Felix Lange <fjl@twurst.com>

* core/state: fix eta calculation on pruning (#22386)

* les: UDP pre-negotiation of available server capacity (#22183)

This PR implements the first one of the "lespay" UDP queries which
is already useful in itself: the capacity query. The server pool is making
use of this query by doing a cheap UDP query to determine whether it is
worth starting the more expensive TCP connection process.

* core/rawdb: fix the transaction indexer (#22395)

* core, eth: unship EIP 2315

* core/vm/runtime: more unshipping

* cmd/geth: put allowUnsecureTx flag in RPC section (#22412)

* params: update chts (#22418)

* cmd/utils: fix txlookuplimit for archive node (#22419)

* cmd/utils: fix exclusive check for archive node

* cmd/utils: set the txlookuplimit to 0

* core/forkid, params: unset Berlin fork number (#22413)

* les: fix nodiscover option on the client side (#22422)

* cmd: retire whisper flags (#22421)

* cmd: retire whisper flags

* cmd/geth: remove whisper configs

* tests: update to latest tests (#22290)

This updates the consensus tests to commit 31d6630 and
adds support for access list transactions in the test runner.

Co-authored-by: Martin Holst Swende <martin@swende.se>

* params: release geth 1.10.0 stable

* params: begin v1.10.1 release cycle

* Revert "core/forkid, params: unset Berlin fork number (#22413)"

This reverts commit ba999105ef89473cfe39e5e53354f7099e67a290.

* build: fix PPA failure due to updated debsrc

* build: add support for Ubuntu Hirsute Hippo

* tests: update reference tests with 2315 removed from Berlin

* params: release Geth v1.10.1

* params: begin v1.10.2 release cycle

* core/types: reduce allocations in GasPriceCmp (#22456)

* les: fix errors in metric namespace (#22459)

* les: add trailing slash to metric namespace

* les: omit '.' in metric namespace

* cmd: extend dumpgenesis to support network flags on the cmd (#22406)

* p2p/enr: fix decoding of incomplete lists (#22484)

Given a list of less than two elements DecodeRLP returned rlp.EOL,
leading to issues in outer decoders.

* cmd/geth: add ancient datadir flag to snapshot subcommands (#22486)

* cmd/devp2p: better testcase failure output for ethtests (#22482)

* eth, les: properly init statedb accesslist during tracing (#22480)

* eth/state, les/state: properly init statedb accesslist when tracing, fixes #22475

* eth: review comments

* eth/tracers: fix compilation err

* eth/tracers: apply @karalabe's suggested fix

* cmd/geth, eth/downloader: remove copydb command (#22501)

* cmd/geth: remove copydb command

* eth/downloader: remove fakepeer

* tests/fuzzers: fix goroutine leak in les fuzzer (#22455)

The oss-fuzz fuzzer has been reporting some failing testcases for les. They're all spurious, and cannot reliably be reproduced. However, running them showed that there was a goroutine leak: the tests created a lot of new clients, which started an exec queue that was never torn down.

This PR fixes the goroutine leak, and also a log message which was erroneously formatted.

* core/types: improve comments in new EIP-2718 code (#22402)

Responding to these comments:

    https://github.com/ethereum/go-ethereum/pull/21502/files#r579010962
    https://github.com/ethereum/go-ethereum/pull/21502/files#r579021565
    https://github.com/ethereum/go-ethereum/pull/21502/files#r579023510
    https://github.com/ethereum/go-ethereum/pull/21502/files#r578983734

* cmd/clef: docs - link to ethereum org repo (#22400)

* cmd/clef (docs): fix image background (#22399)

Flatten the image so we do not have dark text on dark background

* core/rawdb: fix transaction indexing/unindexing hashing error (#22457)

* core/rawdb: more verbose error logs + better hashing

* core/rawdb: add failing testcase

* core/rawdb: properly hash transactions while indexing/unindexing

* core/rawdb: exit on error + better log msg

* les: fix UDP connection query (#22451)

This PR fixes multiple issues with the UDP connection pre-negotiation feature:

- the enable condition was wrong (it checked the existence of the DiscV5 struct where it wasn't initialized yet, disabling the feature even if discv5 was enabled)
- the server pool queried already connected nodes when the discovery iterators returned them again
- servers responded positively before they were synced and really willing to accept connections

Metrics are also added on the server side that count the positive and negative replies to served connection queries.

* les: fix UDP connection query (#22451)

This PR fixes multiple issues with the UDP connection pre-negotiation feature:
- the enable condition was wrong (it checked the existence of the DiscV5 struct where it wasn't initialized yet, disabling the feature even if discv5 was enabled)
- the server pool queried already connected nodes when the discovery iterators returned them again
- servers responded positively before they were synced and really willing to accept connections

Metrics are also added on the server side that count the positive and negative replies to served connection queries.

* les: allow either full enode strings or raw hex ids in the API (#22423)

* eth/protocols/snap, eth/downloader: don't use bloom filter in snap sync

* eth/protocols/snap: fix typo (#22530)

* cmd/devp2p/internal/ethtest: return request ID in BlockHeaders response (#22508)

This PR fixes an issue with the eth66 test suite where, during a readAndServe when
the test is manually responding to GetBlockHeader requests, it now responds
with a BlockHeaders eth66 packet that includes the inbound request ID.

* ethclient: fix error handling for header test (#22514)

The wantErr field was disused, and the error returned by HeaderByNumber
was not properly tested.

This simplifies the error checking using errors.Is and asserts that getting
an expected missing header returns ethereum.NotFound. Also adds a nil
check condition for header.Number before using big.Int's Sign method.

* accounts/abi/bind: add NoSend transact option (#22446)

This adds a new option to avoid sending the transaction which is
created by calling a bound contract method.

* go.mod: upgrade goleveldb to commit 64b5b1c (#22436)

This pulls in a fix for a corruption issue when the process crashes
while a new manifest file is being added.

* go.mod: upgrade goupnp to commit 0ca76305 (#22479)

This pulls in a fix to skip the broadcast on interfaces which are down.

* consensus/ethash: remove unnecessary variable definition (#22512)

* cmd/devp2p: use AWS-SDK v2 (#22360)

This updates the DNS deployer to use AWS SDK v2. Migration is relatively
seamless, although there were two locations that required a slightly
different approach to achieve the same results. In particular, waiting for
DNS change propagation is very different with SDK v2. 

This change also optimizes DNS updates by publishing all changes before
waiting for propagation.

* p2p/dnsdisc: fix flaw in dns size calculation (#22533)

This fixes the calculation of the tree branch factor. With the new
formula, we now creat at most 13 children instead of 30, ensuring
the TXT record size will be below 370 bytes.

* core: fix potential race in chainIndexerTest (#22346)

* cmd/devp2p/internal/ethtest: skip eth/66 tests when v66 not supported (#22460)

* cmd/devp2p: add flag for AWS region (#22537)

* cmd/devp2p: fix error in updating the cursor when collecting records for route53 (#22538)

This PR fixes a regression introduced in #22360, when we updated to the v2 of the AWS sdk, which causes current crawler to just get the same first 100 results over and over, and get stuck in a loop.

* cmd/devp2p: add old block announcement test to eth test suite (#22474)

Add old block announcement test to eth test suite, checks to make sure old block announcement isn't propagated

* cmd/utils: fix compilation issue on openbsd (#22511)

* core: fix method comment for `txpool.requestReset` (#22543)

* accounts: eip-712 signing for ledger (#22378)

* accounts: eip-712 signing for ledger

* address review comments

* all: add read-only option to database (#22407)

* all: add read-only option to database

* all: fixes tests

* cmd/geth: migrate flags

* cmd/geth: fix the compact

* cmd/geth: fix the format

* cmd/geth: fix log

* cmd: add chain-readonly

* core: add readonly notion to freezer

* core/rawdb: add log

* core/rawdb: fix freezer close

* cmd: fix

* cmd, core: construct db

* core: update tests

* cmd/geth: check block range against chain head in export cmd (#22387)

Check the input parameters against the actual head block, exit on error

* core/state/snapshot: fix panic on missing parent

* internal/web3ext, node: migrate node admin API (Start|Stop)RPC->HTTP (#22461)

* internal/web3ext,node: migrate node admin API (Start|Stop)RPC->HTTP

Corresponding CLI flags --rpc have been moved to --http.

This moves the admin module HTTP RPC start/stop
methods to an equivalent namespace.

Rel https://github.com/ethereum/go-ethereum/pull/22263

Date: 2021-03-08 08:00:11-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* internal/web3ext: fix startRPC/HTTP param count (4->5)

Date: 2021-03-16 06:13:23-05:00
Signed-off-by: meows <b5c6@protonmail.com>

* cmd/devp2p: skip ENR field tails properly in nodeset filter (#22565)

In Geth v1.10, we changed the structure of the "les" ENR entry. As a result, the DHT crawler that creates the DNS lists
no longer recognizes the les nodes, which is fixed in this commit. 

* cmd/devp2p: skip ENR field tails properly in nodeset filter
* cmd/devp2p: fix tail decoder for snap as well
* les: fix tail decoding in "eth" ENR entry

* p2p: fix minor typo and remove fd parameter in checkInboundConn (#22547)

* p2p/dnsdisc: rate limit resolving before checking cache (#22566)

This makes the rate limit apply regardless of whether the node is
already cached.

* eth/protocols/snap: fix the flaws in the snap sync (#22553)

* eth/protocols/snap: fix snap sync

* eth/protocols/snap: fix tests

* eth: fix tiny

* eth: update tests

* eth: update tests

* core/state/snapshot: testcase for #22534

* eth/protocols/snap: fix boundary loss on full-but-proven range

* core/state/snapshot: lintfix

* eth: address comment

* eth: fix handler

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* eth/tracers, core: use scopecontext in tracers, provide statedb in capturestart (#22333)

Fixes the CaptureStart api to include the EVM, thus being able to set the statedb early on. This pr also exposes the struct we used internally in the interpreter to encapsulate the contract, mem, stack, rstack, so we pass it as a single struct to the tracer, and removes the error returns on the capture methods.

* core: fix condition on header verification

* cmd/devp2p: fix comparison of TXT record value (#22572)

* cmd/devp2p: fix comparison of TXT record value

The AWS API returns quoted DNS strings, so we must encode the new value
before comparing it against the existing record content.

* cmd/devp2p: add test

* cmd/devp2p: fix typo and rename val -> newValue

* eth: dump rpc gas cap and tx fee cap (#22574)

* eth/protocols, metrics, p2p: add handler performance metrics

* eth/protocols, metrics: use resetting histograms for rare packets

* eth: fix corner case in sync head determination (#21695)

This avoids synchronisation failures when the local header is ahead of
the local full block.

* cmd/geth, consensus/ethash: add support for --miner.notify.full flag (#22558)

The PR implements the --miner.notify.full flag that enables full pending block
notifications. When this flag is used, the block notifications sent to mining
endpoints contain the complete block header JSON instead of a work package
array.

Co-authored-by: AlexSSD7 <alexandersadovskyi7@protonmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* metrics/influxdb: don't push empty histograms, no measurement != 0

* eth/protocols/snap: add peer id and req id to the timeout logs

* cmd/devp2p: update to newer cloudflare API client (#22588)

This upgrades the cloudflare client dependency to v0.14.0. The new
version changes the API because all methods now require a context
parameter. This change also reduces the log level of the 'Skipping...'
message to debug, following a similar change in the AWS deployer.

* core/state/pruner: move the compaction out of the pruning procedure (#22579)

The main idea behind it is: the range compaction is very expensive
which can take a few hours to finish. During this long procedure,
a lot of exceptions can occur, e.g.
- Geth is killed manually
- Geth is killed because of machine crash
- etc

In order to minimize the effect of the exceptions, the compaction
is moved out of the pruning. So that even the compaction is not
finished, the pruning is regarded as done.

* eth/protocols/snap: try to prevent requests timing out

* core: add BlockGen.GetBalance method  (#22589)

* cmd/puppeth: specify working directory for nodejs 15 (#22549)

* cmd/geth: add db dumptrie command (#22563)

Adds the command "geth db dumptrie <root> <seek> <max>", to better help investigate the trie data

* core/vm: fix Byzantium address list (#22603)

* ethstats: avoid creating subscriptions on background goroutine (#22587)

This fixes an issue where the ethstats service could crash if geth was
started and then immediately stopped due to an internal error. The
cause of the crash was a nil subscription being returned by the backend,
because the background goroutine creating them was scheduled after
the backend had already shut down.

Moving the creation of subscriptions into the Start method, which runs
synchronously during startup of the node, means the returned subscriptions
can never be 'nil'.

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* core/state/snapshot, ethdb: track deletions more accurately (#22582)

* core/state/snapshot, ethdb: track deletions more accurately

* core/state/snapshot: don't reset the iterator, leveldb's screwy

* ethdb: don't mess with the insert batches for now

* rpc: tighter shutdown synchronization in client subscription (#22597)

This fixes a rare issue where the client subscription forwarding loop
would attempt send on the subscription's channel after Unsubscribe has
returned, leading to a panic if the subscription channel was already
closed by the user. Example:

    sub, _ := client.Subscribe(..., channel, ...)
    sub.Unsubscribe()
    close(channel)

The race occurred because Unsubscribe called quitWithServer to tell the
forwarding loop to stop sending on sub.channel, but did not wait for the
loop to actually come down. This is fixed by adding an additional channel
to track the shutdown, on which Unsubscribe now waits.

Fixes #22322

* all: fix miner hashRate -> hashrate on API calls

* core/state/snapshot: fix data race in diff layer (#22540)

* internal/ethapi: fix eth_chainId method (#22243)

This removes the duplicated definition of eth_chainID
in package eth and updates the definition in internal/ethapi
to treat chain ID as a bigint.

Co-authored-by: Felix Lange <fjl@twurst.com>

* graphql: add support for tx types and tx access lists (#22491)

This adds support for EIP-2718 access list transactions in the GraphQL API.

Co-authored-by: Amit Shah <amitshah0t7@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>

* internal/debug: add JSON log format and rename logging flags (#22341)

This change adds support for logging JSON records when the --log.json flag is
given. The --debug and --backtrace flags are deprecated and replaced by
--log.debug and --log.backtrace.

While changing this, it was noticed that the --memprofilerate and
--blockprofilerate were ineffective (they were always overridden even if
--pprof.memprofilerate was not set). This is also fixed.

Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd/utils: move cache sanity check to SetEthConfig (#22510)

Move the cache sanity check to the SetEthConfig function
to allow the config file to load.

* consensus/ethash: replace a magic number with it's constant (#22618)

* les: move client pool to les/vflux/server (#22495)

* les: move client pool to les/vflux/server

* les/vflux/server: un-expose NodeBalance, remove unused fn, fix bugs

* tests/fuzzers/vflux: add ClientPool fuzzer

* les/vflux/server: fixed balance tests

* les: rebase fix

* les/vflux/server: fixed more bugs

* les/vflux/server: unexported NodeStateMachine fields and flags

* les/vflux/server: unexport all internal components and functions

* les/vflux/server: fixed priorityPool test

* les/vflux/server: polish balance

* les/vflux/server: fixed mutex locking error

* les/vflux/server: priorityPool bug fixed

* common/prque: make Prque wrap-around priority handling optional

* les/vflux/server: rename funcs, small optimizations

* les/vflux/server: fixed timeUntil

* les/vflux/server: separated balance.posValue and negValue

* les/vflux/server: polish setup

* les/vflux/server: enforce capacity curve monotonicity

* les/vflux/server: simplified requestCapacity

* les/vflux/server: requestCapacity with target range, no iterations in SetCapacity

* les/vflux/server: minor changes

* les/vflux/server: moved default factors to balanceTracker

* les/vflux/server: set inactiveFlag in priorityPool

* les/vflux/server: moved related metrics to vfs package

* les/vflux/client: make priorityPool temp state logic cleaner

* les/vflux/server: changed log.Crit to log.Error

* add vflux fuzzer to oss-fuzz

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* eth, les: fix tracers (#22473)

* eth, les: fix tracer

* eth: isolate live trie database in tracer

* eth: fix nil

* eth: fix

* eth, les: add checkLive param

* eth/tracer: fix

* core, eth, internal/ethapi: create access list RPC API (#22550)

* core/vm: implement AccessListTracer

* eth: implement debug.createAccessList

* core/vm: fixed nil panics in accessListTracer

* eth: better error messages for createAccessList

* eth: some fixes on CreateAccessList

* eth: allow for provided accesslists

* eth: pass accesslist by value

* eth: remove created acocunt from accesslist

* core/vm: simplify access list tracer

* core/vm: unexport accessListTracer

* eth: return best guess if al iteration times out

* eth: return best guess if al iteration times out

* core: docstring, unexport methods

* eth: typo

* internal/ethapi: move createAccessList to eth package

* internal/ethapi: remove reexec from createAccessList

* internal/ethapi: break if al is equal to last run, not if gas is equal

* internal/web3ext: fixed arguments

* core/types: fixed equality check for accesslist

* core/types: no hardcoded vals

* core, internal: simplify access list generation, make it precise

* core/vm: fix typo

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* eth: fix tracing state retrieval if requesting the non-dirty genesis

* params: update CHTs for v1.10.2

* params: release go-ethereum v1.10.2 stable

* params: begin v1.10.3 release cycle

* eth, les: drop support for eth/64, fix eth/66 tests

* accounts: documentation fixes (#22645)

* replaces `an chance` with `a chance`
* replaces `SignHashWithPassphrase` with `SignTextWithPassphrase` as there was no SignHashWithPasspharse function in the file

* cmd/geth: add db-command to inspect freezer index (#22633)

This PR makes it easier to inspect the freezer index, which could be useful to investigate things like #22111

* cmd/faucet: support testnet flags in the faucet (#22545)


Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth/fetcher: avoid spurious timer events at startup (#22652)


Co-authored-by: Felix Lange <fjl@twurst.com>

* core, eth: faster snapshot generation (#22504)

* eth/protocols: persist received state segments

* core: initial implementation

* core/state/snapshot: add tests

* core, eth: updates

* eth/protocols/snapshot: count flat state size

* core/state: add metrics

* core/state/snapshot: skip unnecessary deletion

* core/state/snapshot: rename

* core/state/snapshot: use the global batch

* core/state/snapshot: add logs and fix wiping

* core/state/snapshot: fix

* core/state/snapshot: save generation progress even if the batch is empty

* core/state/snapshot: fixes

* core/state/snapshot: fix initial account range length

* core/state/snapshot: fix initial account range

* eth/protocols/snap: store flat states during the healing

* eth/protocols/snap: print logs

* core/state/snapshot: refactor (#4)

* core/state/snapshot: refactor

* core/state/snapshot: tiny fix and polish

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* core, eth: fixes

* core, eth: fix healing writer

* core, trie, eth: fix paths

* eth/protocols/snap: fix encoding

* eth, core: add debug log

* core/state/generate: release iterator asap (#5)

core/state/snapshot: less copy

core/state/snapshot: revert split loop

core/state/snapshot: handle storage becoming empty, improve test robustness

core/state: test modified codehash

core/state/snapshot: polish

* core/state/snapshot: optimize stats counter

* core, eth: add metric

* core/state/snapshot: update comments

* core/state/snapshot: improve tests

* core/state/snapshot: replace secure trie with standard trie

* core/state/snapshot: wrap return as the struct

* core/state/snapshot: skip wiping correct states

* core/state/snapshot: updates

* core/state/snapshot: fixes

* core/state/snapshot: fix panic due to reference flaw in closure

* core/state/snapshot: fix errors in state generation logic + fix log output

* core/state/snapshot: remove an error case

* core/state/snapshot: fix condition-check for exhausted snap state

* core/state/snapshot: use stackTrie for small tries

* core/state/snapshot: don't resolve small storage tries in vain

* core/state/snapshot: properly clean up storage of deleted accounts

* core/state/snapshot: avoid RLP-encoding in some cases + minor nitpicks

* core/state/snapshot: fix error (+testcase)

* core/state/snapshot: clean up tests a bit

* core/state/snapshot: work in progress on better tests

* core/state/snapshot: polish code

* core/state/snapshot: fix trie iteration abortion trigger

* core/state/snapshot: fixes flaws

* core/state/snapshot: remove panic

* core/state/snapshot: fix abort

* core/state/snapshot: more tests (plus failing testcase)

* core/state/snapshot: more testcases + fix for failing test

* core/state/snapshot: testcase for malformed data

* core/state/snapshot: some test nitpicks

* core/state/snapshot: improvements to logging

* core/state/snapshot: testcase to demo error in abortion

* core/state/snapshot: fix abortion

* cmd/geth: make verify-state report the root

* trie: fix failing test

* core/state/snapshot: add timer metrics

* core/state/snapshot: fix metrics

* core/state/snapshot: udpate tests

* eth/protocols/snap: write snapshot account even if code or state is needed

* core/state/snapshot: fix diskmore check

* core/state/snapshot: review fixes

* core/state/snapshot: improve error message

* cmd/geth: rename 'error' to 'err' in logs

* core/state/snapshot: fix some review concerns

* core/state/snapshot, eth/protocols/snap: clear snapshot marker when starting/resuming snap sync

* core: add error log

* core/state/snapshot: use proper timers for metrics collection

* core/state/snapshot: address some review concerns

* eth/protocols/snap: improved log message

* eth/protocols/snap: fix heal logs to condense infos

* core/state/snapshot: wait for generator termination before restarting

* core/state/snapshot: revert timers to counters to track total time

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* core/types: drop some relice data types

* all: make logs a bit easier on the eye to digest (#22665)

* all: add thousandths separators for big numbers on log messages

* p2p/sentry: drop accidental file

* common, log: add fast number formatter

* common, eth/protocols/snap: simplifty fancy num types

* log: handle nil big ints

* eth/protocols/snap: use ephemeral channels to avoid cross-sync delveries

* core: add TestGenesisHashes and fix YoloV3 (#22559)

This adds simple unit test checking if the hard-coded genesis
hash values in package params match the actual genesis block hashes.

* log: fix formatting of big.Int (#22679)

* log: fix formatting of big.Int

The implementation of formatLogfmtBigInt had two issues: it crashed when
the number was actually large enough to hit the big integer case, and
modified the big.Int while formatting it.

* log: don't call FormatLogfmtInt64 for int16

* log: separate from decimals back, not front

Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* les/vflux/server: fix priority cornercase causing fuzzer timeout (#22650)

* les/vflux/server: fix estimatePriority corner case

* les/vflux/server: simplify inactiveAllowance == 0 case

* trie: make stacktrie not mutate input values (#22673)

The stacktrie is a bit un-untuitive, API-wise: since it mutates input values.
Such behaviour is dangerous, and easy to get wrong if the calling code 'forgets' this quirk. The behaviour is fixed by this PR, so that the input values are not modified by the stacktrie. 

Note: just as with the Trie, the stacktrie still references the live input objects, so it's still _not_ safe to mutate the values form the callsite.

* core/state/snapshot: avoid copybytes for stacktrie

* eth/catalyst: add catalyst API prototype (#22641)

This change adds the --catalyst flag, enabling an RPC API for eth2 integration.
In this initial version, catalyst mode also disables all peer-to-peer networking.

Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd/devp2p: add support for -limit option in nodeset filter command (#22694)

The new -limit option makes the filter operate on top N nodes by score.
This also adds ENR attribute stats in the nodeset info command.
Node set commands are now documented in README.

* cmd/devp2p: add dns nuke-route53 command (#22695)

* builds

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Dan DeGreef <dan.degreef@gmail.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Alex Mazalov <mazalov@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: ucwong <ucwong@126.com>
Co-authored-by: meowsbits <b5c6@protonmail.com>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: Łukasz Zimnoch <lukaszzimnoch1994@gmail.com>
Co-authored-by: ligi <ligi@ligi.de>
Co-authored-by: rene <41963722+renaynay@users.noreply.github.com>
Co-authored-by: Melvin Junhee Woo <melvin.woo@groundx.xyz>
Co-authored-by: Guillaume Ballet <gballet@gmail.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: Alex Prut <1648497+alexprut@users.noreply.github.com>
Co-authored-by: isdyaufh8o7cq <sebaskil@icloud.com>
Co-authored-by: Or Neeman <oneeman@gmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: michael1011 <me@michael1011.at>
Co-authored-by: wuff1996 <33193253+wuff1996@users.noreply.github.com>
Co-authored-by: Martin Redmond <21436+reds@users.noreply.github.com>
Co-authored-by: jacksoom <lifengliu1994@gmail.com>
Co-authored-by: Quest Henkart <qhenkart@gmail.com>
Co-authored-by: Tobias Hildebrandt <79341166+tobias-hildebrandt@users.noreply.github.com>
Co-authored-by: Derek Chiang <me@derekchiang.com>
Co-authored-by: MrChico <martin.lundfall@protonmail.com>
Co-authored-by: Chen Quan <terasum@163.com>
Co-authored-by: Zou Guangxian <zouguangxian@gmail.com>
Co-authored-by: AlexSSD7 <alexandersadovskyi7@protonmail.com>
Co-authored-by: nebojsa94 <nebojsa94@users.noreply.github.com>
Co-authored-by: Edgar Aroutiounian <edgar.factorial@gmail.com>
Co-authored-by: piersy <pierspowlesland@gmail.com>
Co-authored-by: AmitBRD <60668103+AmitBRD@users.noreply.github.com>
Co-authored-by: Amit Shah <amitshah0t7@gmail.com>
Co-authored-by: Peter Simard <petesimard56@gmail.com>
Co-authored-by: Evolution404 <35091674+Evolution404@users.noreply.github.com>
Co-authored-by: Balaji Shetty Pachai <32358081+balajipachai@users.noreply.github.com>
Co-authored-by: Mudit Gupta <guptamudit@ymail.com>
Co-authored-by: xD AKA Rapper King Of cn background diablo & revelations <33193253+r1cs@users.noreply.github.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
mandrigin pushed a commit to erigontech/erigon that referenced this pull request Apr 21, 2021
…(#22461)

* internal/web3ext,node: migrate node admin API (Start|Stop)RPC->HTTP

Corresponding CLI flags --rpc have been moved to --http.

This moves the admin module HTTP RPC start/stop
methods to an equivalent namespace.

Rel ethereum/go-ethereum#22263

Date: 2021-03-08 08:00:11-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* internal/web3ext: fix startRPC/HTTP param count (4->5)

Date: 2021-03-16 06:13:23-05:00
Signed-off-by: meows <b5c6@protonmail.com>
# Conflicts:
#	node/api.go
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
…thereum#22461)

* internal/web3ext,node: migrate node admin API (Start|Stop)RPC->HTTP

Corresponding CLI flags --rpc have been moved to --http.

This moves the admin module HTTP RPC start/stop
methods to an equivalent namespace.

Rel ethereum#22263

Date: 2021-03-08 08:00:11-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* internal/web3ext: fix startRPC/HTTP param count (4->5)

Date: 2021-03-16 06:13:23-05:00
Signed-off-by: meows <b5c6@protonmail.com>
acoshift pushed a commit to reichain/rei that referenced this pull request Mar 30, 2022
…(#22461)

* internal/web3ext,node: migrate node admin API (Start|Stop)RPC->HTTP

Corresponding CLI flags --rpc have been moved to --http.

This moves the admin module HTTP RPC start/stop
methods to an equivalent namespace.

Rel ethereum/go-ethereum#22263

Date: 2021-03-08 08:00:11-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* internal/web3ext: fix startRPC/HTTP param count (4->5)

Date: 2021-03-16 06:13:23-05:00
Signed-off-by: meows <b5c6@protonmail.com>
antonydenyer pushed a commit to Consensys/quorum that referenced this pull request Jun 1, 2022
* cmd/faucet: update the embedded website asset

* core/state/snapshot: add generation logs to storage too

* les: don't drop sentTo for normal cases (#22048)

* eth/protocols/eth: fix slice resize flaw (#22181)

* les: remove useless protocol defines (#22115)

This PR has two changes in the les protocol:

- the auxRoot is not supported. See ethereum/devp2p#171 for more information
- the empty response will be returned in GetHelperTrieProofsMsg request if the merkle
   proving is failed. note, for backward compatibility, the empty merkle proof as well as
   the request auxiliary data will still be returned in  les2/3 protocol no matter the proving
   is successful or not. the proving failure can happen e.g. request the proving for a
   non-included entry in helper trie (unstable header).

* tests/fuzzers/abi: better test generation (#22158)

* tests/fuzzers/abi: better test generation

* tests/fuzzers/abi: fixed packing issue

* oss-fuzz: enable abi fuzzer

* cmd/geth: dump config for metrics (#22083)

* cmd/geth: dump config

* cmd/geth: dump config

* cmd/geth: properly read config again

* cmd/geth: override metrics if flags are set

* cmd/geth: write metrics regardless if enabled

* cmd/geth: renamed to metricsfromcliargs

* metrics: add default configuration

* core/state/snapshot: write snapshot generator in batch (#22163)

* core/state/snapshot: write snapshot generator in batch

* core: refactor the tests

* core: update tests

* core: update tests

* cmd/geth: graceful shutdown if disk is full (#22103)

Adding warnings of free disk space left and graceful shutdown when there is not enough space left.
This also adds a flag datadir.minfreedisk which can be used to set the trigger for low disk space, and setting it to zero disables the check. 

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>

* eth, les: add new config field SyncFromCheckpoint (#22123)

This PR introduces a new config field SyncFromCheckpoint for light client.

In some special scenarios, it's required to start synchronization from some
arbitrary checkpoint or even from the scratch. So this PR offers this
flexibility to users so that the synchronization start point can be configured.

There are two relevant configs: SyncFromCheckpoint and Checkpoint.

- If the SyncFromCheckpoint is true, the light client will try to sync from the
  specified checkpoint.

- If the Checkpoint is not configured, then the light client will sync from the
  scratch(from the latest header if the database is not empty)

Additional notes: these two configs are not visible in the CLI flags but only
accessable in the config file.

Example Usage:

[Eth]
SyncFromCheckpoint = true

[Eth.Checkpoint]
SectionIndex = 100
SectionHead = "0xabc"
CHTRoot = "0xabc"
BloomRoot = "0xabc"

PS. Historical checkpoint can be retrieved from the synced full node or light
client via les_getCheckpoint API.

* oss-fuzz: fix abi fuzzer (#22199)

* go.mod: upgrade golang-lru (#22134)

* downloader: extract findAncestor search functions (#21744)

This is a simple refactoring, extracting common ancestor
negotiation logic to named function

* core: implement background trie prefetcher

Squashed from the following commits:

core/state: lazily init snapshot storage map
core/state: fix flawed meter on storage reads
core/state: make statedb/stateobjects reuse a hasher
core/blockchain, core/state: implement new trie prefetcher
core: make trie prefetcher deliver tries to statedb
core/state: refactor trie_prefetcher, export storage tries
blockchain: re-enable the next-block-prefetcher
state: remove panics in trie prefetcher
core/state/trie_prefetcher: address some review concerns

sq

* core/state: convert prefetcher to concurrent per-trie loader

* eth/filters: fix potential deadlock in filter timeout loop (#22178)

This fixes #22131 and adds a test reproducing the issue.

* event: add ResubscribeErr (#22191)

This adds a way to get the error of the failing subscription
for logging/debugging purposes.

Co-authored-by: Felix Lange <fjl@twurst.com>

* trie: fix range prover (#22210)

Fixes a special case when the trie only has a single trie node and the range proof only contains a single element.

* common/mclock: remove dependency on github.com/aristanetworks/goarista (#22211)

It takes three lines of code to get to runtime.nanotime, no need to
pull a dependency for that.

* cmd, geth: CLI help fixes (#22220)

* cmd, geth: Reflect command being optional - closes 22218

* cmd, geth: Set current year to 2021

* cmd, geth: CLI help fixes (#22220)

* cmd, geth: Reflect command being optional - closes 22218

* cmd, geth: Set current year to 2021

* eth/protocols/snap: snap sync testing (#22179)

* eth/protocols/snap: make timeout configurable

* eth/protocols/snap: snap sync testing

* eth/protocols/snap: test to trigger panic

* eth/protocols/snap: fix race condition on timeouts

* eth/protocols/snap: return error on cancelled sync

* squashme: updates + test causing panic + properly serve accounts in order

* eth/protocols/snap: revert failing storage response

* eth/protocols/snap: revert on bad responses (storage, code)

* eth/protocols/snap: fix account handling stall

* eth/protocols/snap: fix remaining revertal-issues

* eth/protocols/snap: timeouthandler for bytecode requests

* eth/protocols/snap: debugging + fix log message

* eth/protocols/snap: fix misspelliings in docs

* eth/protocols/snap: fix race in bytecode handling

* eth/protocols/snap: undo deduplication of storage roots

* synctests: refactor + minify panic testcase

* eth/protocols/snap: minor polishes

* eth: minor polishes to make logs more useful

* eth/protocols/snap: remove excessive logs from the test runs

* eth/protocols/snap: stress tests with concurrency

* eth/protocols/snap: further fixes to test cancel channel handling

* eth/protocols/snap: extend test timeouts on CI

Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* go.mod: update dependencies (#22216)

This updates go module dependencies as discussed in #22050.

* graphql: change receipt status to decimal instead of hex (#22187)

This PR fixes the receipt status field to be decimal instead of a hex string,
as called for by the spec.

Co-authored-by: Martin Holst Swende <martin@swende.se>

* go.mod: upgrade github.com/huin/goupnp (#22227)

This updates the goupnp dependency, fixing huin/goupnp#33

* snapshot: merge loops for better performance (#22160)

* core: reset to genesis when middle block is missing (#22135)

When a sethead/rewind finds that the targeted block is missing, it resets to genesis instead of crashing. Closes #22129

* eth/tracers: move tracing APIs into eth/tracers (#22161)

This moves the tracing RPC API implementation to package eth/tracers.
By doing so, package eth no longer depends on tracing and the duktape JS engine.

The change also enables tracing using the light client. All tracing methods work with the
light client, but it's a lot slower compared to using a full node.

* eth, p2p: reserve half peer slots for snap peers during snap sync (#22171)

* eth, p2p: reserve half peer slots for snap peers during snap sync

* eth: less logging

* eth: rework the eth/snap peer reservation logic

* eth: rework the eth/snap peer reservation logic (again)

* tests/fuzzers/abi: fixed one-off panic with int.Min64 value (#22233)

* tests/fuzzers/abi: fixed one-off panic with int.Min64 value

* tests/fuzzers/abi: fixed one-off panic with int.Min64 value

* internal/ethapi: print tx details when submitting (#22170)

This adds more info about submitted transactions in log messages.

Co-authored-by: Felix Lange <fjl@twurst.com>

* core/state: fix panic in state dumping (#22225)

* core: speed up header import (#21967)

This PR implements the following modifications

- Don't shortcut check if block is present, thus avoid disk lookup
- Don't check hash ancestry in early-check (it's still done in parallel checker)
- Don't check time.Now for every single header

Charts and background info can be found here: https://github.com/holiman/headerimport/blob/main/README.md
With these changes, writing 1M headers goes down to from 80s to 62s.

* accounts/scwallet: use go-ethereum crypto instead of go-ecdh (#22212)

* accounts/scwallet: use go-ethereum crypto instead of go-ecdh

github.com/wsddn/go-ecdh is a wrapper package for ECDH functionality
with any elliptic curve.

Since 'generic' ECDH is not required in accounts/scwallet (the curve is
always secp256k1), we can just use the standard library functionality
and our own crypto libraries to perform ECDH and save a dependency.

* Update accounts/scwallet/securechannel.go

Co-authored-by: Guillaume Ballet <gballet@gmail.com>

* Use the correct key

Co-authored-by: Guillaume Ballet <gballet@gmail.com>

* accounts/scwallet: update documentation (#22242)

* les: switch to new discv5 (#21940)

This PR enables running the new discv5 protocol in both LES client
and server mode. In client mode it mixes discv5 and dnsdisc iterators
(if both are enabled) and filters incoming ENRs for "les" tag and fork ID.
The old p2p/discv5 package and all references to it are removed.

Co-authored-by: Felix Lange <fjl@twurst.com>

* rpc: deprecate Client.ShhSubscribe (#22239)

It never worked, whisper uses polling.

Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd,core,eth,params,tests: define yolov3 + enable EIP-2565 (#22213)

Removes the yolov2 definition, adds yolov3, including EIP-2565. This PR also disables some of the erroneously generated blockchain and statetests, and adds the new genesis hash + alloc for yolov3. 
This PR disables the CLI switches for yolo, since it's not complete until we merge support for 2930.

* les/utils: UDP rate limiter (#21930)

* les/utils: Limiter

* les/utils: dropped prior weight vs variable cost logic, using fixed weights

* les/utils: always create node selector in addressGroup

* les/utils: renamed request weight to request cost

* les/utils: simplified and improved the DoS penalty mechanism

* les/utils: minor fixes

* les/utils: made selection weight calculation nicer

* les/utils: fixed linter warning

* les/utils: more precise and reliable probabilistic test

* les/utils: fixed linter warning

* cmd/clef: don't check file permissions on windows (#22251)

Fixes #20123

* eth/tracers: fix unigram tracer (#22248)

* eth: check snap satelliteness, delegate drop to eth (#22235)

* eth: check snap satelliteness, delegate drop to eth

* eth: better handle eth/snap satellite relation, merge reg/unreg paths

* cmd/geth, node: allow configuring JSON-RPC on custom path prefix (#22184)

This change allows users to set a custom path prefix on which to mount the http-rpc
or ws-rpc handlers via the new flags --http.rpcprefix and --ws.rpcprefix.

Fixes #21826

Co-authored-by: Felix Lange <fjl@twurst.com>

* all: remove unneeded parentheses (#21921)

* remove uneeded convertion type

* remove redundant type in composite literal

* omit explicit type where implicit

* remove unused redundant parenthesis

* remove redundant import alias duktape

* trie : use trie.NewStackTrie instead of new(trie.Trie) (#22246)

The PR makes use of the stacktrie, which is is more lenient on resource consumption, than the regular trie, in cases where we only need it for DeriveSha

* core: reset txpool state on sethead (#22247)

fixes an issue where local transactions that were included in the chain before a SetHead were rejected if resubmitted, since the txpool had not reset the state to the current (older) state.

* fuzzers: added consensys/gurvy library to bn256 differential fuzzer (#21812)

This pr adds consensys' gurvy bn256 variant into the code for differential fuzzing.

* internal/ethapi: comment nitpick (#22270)

* eth: move eth.Config to a common package (#22205)

This moves the eth config definition into a separate package, eth/ethconfig. 
Packages eth and les can now import this common package instead of
importing eth from les, reducing dependencies.

Co-authored-by: Felix Lange <fjl@twurst.com>

* internal/ethapi: fix typo in comment (#22271)

* eth: don't wait for snap registration if we're not running snap (#22272)

Prevents a situation where we (not running snap) connects with a peer running snap, and get stalled waiting for snap registration to succeed (which will never happen), which cause a waitgroup wait to halt shutdown

* consensus: remove seal verification from the consensus engine interface (#22274)

* cmd/utils: enable snapshots by default

* metrics: fix cast omission in cpu_syscall.go (#22262)

fixes an regression which caused build failure on certain platforms

* params: just to make snapshots a bit more official

* all: bloom-filter based pruning mechanism (#21724)

* cmd, core, tests: initial state pruner

core: fix db inspector

cmd/geth: add verify-state

cmd/geth: add verification tool

core/rawdb: implement flatdb

cmd, core: fix rebase

core/state: use new contract code layout

core/state/pruner: avoid deleting genesis state

cmd/geth: add helper function

core, cmd: fix extract genesis

core: minor fixes

contracts: remove useless

core/state/snapshot: plugin stacktrie

core: polish

core/state/snapshot: iterate storage concurrently

core/state/snapshot: fix iteration

core: add comments

core/state/snapshot: polish code

core/state: polish

core/state/snapshot: rebase

core/rawdb: add comments

core/rawdb: fix tests

core/rawdb: improve tests

core/state/snapshot: fix concurrent iteration

core/state: run pruning during the recovery

core, trie: implement martin's idea

core, eth: delete flatdb and polish pruner

trie: fix import

core/state/pruner: add log

core/state/pruner: fix issues

core/state/pruner: don't read back

core/state/pruner: fix contract code write

core/state/pruner: check root node presence

cmd, core: polish log

core/state: use HEAD-127 as the target

core/state/snapshot: improve tests

cmd/geth: fix verification tool

cmd/geth: use HEAD as the verification default target

all: replace the bloomfilter with martin's fork

cmd, core: polish code

core, cmd: forcibly delete state root

core/state/pruner: add hash64

core/state/pruner: fix blacklist

core/state: remove blacklist

cmd, core: delete trie clean cache before pruning

cmd, core: fix lint

cmd, core: fix rebase

core/state: fix the special case for clique networks

core/state/snapshot: remove useless code

core/state/pruner: capping the snapshot after pruning

cmd, core, eth: fixes

core/rawdb: update db inspector

cmd/geth: polish code

core/state/pruner: fsync bloom filter

cmd, core: print warning log

core/state/pruner: adjust the parameters for bloom filter

cmd, core: create the bloom filter by size

core: polish

core/state/pruner: sanitize invalid bloomfilter size

cmd: address comments

cmd/geth: address comments

cmd/geth: address comment

core/state/pruner: address comments

core/state/pruner: rename homedir to datadir

cmd, core: address comments

core/state/pruner: address comment

core/state: address comments

core, cmd, tests: address comments

core: address comments

core/state/pruner: release the iterator after each commit

core/state/pruner: improve pruner

cmd, core: adjust bloom paramters

core/state/pruner: fix lint

core/state/pruner: fix tests

core: fix rebase

core/state/pruner: remove atomic rename

core/state/pruner: address comments

all: run go mod tidy

core/state/pruner: avoid false-positive for the middle state roots

core/state/pruner: add checks for middle roots

cmd/geth: replace crit with error

* core/state/pruner: fix lint

* core: drop legacy bloom filter

* core/state/snapshot: improve pruner

* core/state/snapshot: polish concurrent logs to report ETA vs. hashes

* core/state/pruner: add progress report for pruning and compaction too

* core: fix snapshot test API

* core/state: fix some pruning logs

* core/state/pruner: support recovering from bloom flush fail

Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* core/state/pruner: fix compaction after pruning

* core/state/pruner: fix compaction range error

* internal/debug: add switch to format logs with json (#22207)

adds a flag --log.json which if enabled makes the client format logs with JSON.

* accounts/abi/bind: fixed unpacking error (#22230)

There was a dormant error with structured inputs that failed unpacking.
This commit fixes the error by switching casting to the better abi.ConvertType function.
It also adds a test for calling a view function that returns a struct

* cmd/utils, eth/ethconfig: unindex txs older than ~1 year

* cmd/devp2p: fix documentation for eth-test (#22298)

* core: fix temp memory blowup caused by defers holding on to state

* les: enable les/4 and add tests (#22321)

* cmd/utils: add workaround for FreeBSD statfs quirk (#22310)

Make geth build on FreeBSD, fixes #22309.

* cmd/geth: fix js unclean shutdown (#22302)

* trie: fix bloom crash on fast sync restart

* rpc: increase the number of subscriptions in storm test (#22316)

* core/state/snapshot: ensure Cap retains a min number of layers

* eth: fix snap sync cancellation

* cmd/devp2p/internal/ethtest: use shared message types (#22315)

This updates the eth protocol test suite to use the message type
definitions of the 'production' protocol implementation in eth/protocols/eth.

* eth/handler, broadcast: optimize tx broadcast mechanism (#22176)

This PR optimizes the broadcast loop. Instead of iterating twice through a given set of transactions to weed out which peers have and which do not have a tx, to send/announce transactions, we do it only once.

* core/state: copy the snap when copying the state (#22340)

* core/state: copy the snap when copying the state

* core/state: deep-copy snap stuff during state Copy

* rlp: handle case of normal EOF in Stream.readFull (#22336)

io.Reader may return n > 0 and io.EOF at the end of the input stream.
readFull did not handle this correctly, looking only at the error. This fixes
it to check for n == len(buf) as well.

* node: always show websocket url in logs (#22307)

* eth: implement eth66 (#22241)

* eth/protocols/eth: split up the eth protocol handlers

* eth/protocols/eth: define eth-66 protocol messages

* eth/protocols/eth: poc implement getblockheaders on eth/66

* eth/protocols/eth: implement remaining eth-66 handlers

* eth/protocols: define handler map for eth 66

* eth/downloader: use protocol constants from eth package

* eth/protocols/eth: add ETH66 capability

* eth/downloader: tests for eth66

* eth/downloader: fix error in tests

* eth/protocols/eth: use eth66 for outgoing requests

* eth/protocols/eth: remove unused error type

* eth/protocols/eth: define protocol length

* eth/protocols/eth: fix pooled tx over eth66

* protocols/eth/handlers: revert behavioural change which caused tests to fail

* eth/downloader: fix failing test

* eth/protocols/eth: add testcases + fix flaw with header requests

* eth/protocols: change comments

* eth/protocols/eth: review fixes + fixed flaw in RequestOneHeader

* eth/protocols: documentation

* eth/protocols/eth: review concerns about types

* p2p/dnsdisc: fix hot-spin when all trees are empty (#22313)

In the random sync algorithm used by the DNS node iterator, we first pick a random
tree and then perform one sync action on that tree. This happens in a loop until any
node is found. If no trees contain any nodes, the iterator will enter a hot loop spinning
at 100% CPU.

The fix is complicated. The iterator now checks if a meaningful sync action can
be performed on any tree. If there is nothing to do, it waits for the next root record
recheck time to arrive and then tries again.

Fixes #22306

* les: renamed lespay to vflux (#22347)

* cmd/utils: disable caching preimages by default

* travis, appveyor, build: bump Go to 1.16

* les: fix balance expiration (#22343)

* les/lespay/server: fix balance expiration and add test

* les: move client balances to a new db

* les: rename lespayDb to lesDb

* tests/fuzzers/les: add fuzzer for les server handler (#22282)

* les: refactored server handler

* tests/fuzzers/les: add fuzzer for les server handler

* tests, les: update les fuzzer

tests: update les fuzzer

tests/fuzzer/les: release resources

tests/fuzzer/les: pre-initialize all resources

* les: refactored server handler and fuzzer

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* les: clean up server handler (#22357)

* cmd/geth: add db commands stats, compact, put, get, delete (#22014)

This PR introduces:

- db.put to put a value into the database
- db.get to read a value from the database
- db.delete to delete a value from the database
- db.stats to check compaction info from the database
- db.compact to trigger a db compaction

It also moves inspectdb to db.inspect.

* internal/ethapi: reject non-replay-protected txs over RPC (#22339)

This PR prevents users from submitting transactions without EIP-155 enabled. This behaviour can be overridden by specifying the flag --rpc.allow-unprotected-txs=true.

* accounts/abi/bind: fix up Go mod files for Go 1.16

* Dockerfile: bump to Go 1.16 base images

* travis: bump Android NDK version

* travis: bump builders to Bionic

* travis: manually install Android since Travis is stale (#22373)

* cmd/utils: remove deprecated command line flags (#22263)

This removes support for all deprecated flags except --rpc*.

* eth/protocols/snap: lower abortion and resumption logs to debug

* cmd, eth, les: enable serving light clients when non-synced (#22250)

This PR adds a more CLI flag, so that the les-server can serve light clients even the local node is not synced yet.

This functionality is needed in some testing environments(e.g. hive). After launching the les server, no more blocks will be imported so the node is always marked as "non-synced".

* les, light: improve txstatus retrieval (#22349)

Transaction unindexing will be enabled by default as of 1.10, which causes tx status retrieval will be broken without this PR. 

This PR introduces a retry mechanism in TxStatus retrieval.

* all: add support for EIP-2718, EIP-2930 transactions (#21502)

This adds support for EIP-2718 typed transactions as well as EIP-2930
access list transactions (tx type 1). These EIPs are scheduled for the
Berlin fork.

There very few changes to existing APIs in core/types, and several new APIs
to deal with access list transactions. In particular, there are two new
constructor functions for transactions: types.NewTx and types.SignNewTx.
Since the canonical encoding of typed transactions is not RLP-compatible,
Transaction now has new methods for encoding and decoding: MarshalBinary
and UnmarshalBinary.

The existing EIP-155 signer does not support the new transaction types.
All code dealing with transaction signatures should be updated to use the
newer EIP-2930 signer. To make this easier for future updates, we have
added new constructor functions for types.Signer: types.LatestSigner and
types.LatestSignerForChainID. 

This change also adds support for the YoloV3 testnet.

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* cmd/devp2p: add eth66 test suite (#22363)

Co-authored-by: Martin Holst Swende <martin@swende.se>

* les: move server pool to les/vflux/client (#22377)

* les: move serverPool to les/vflux/client

* les: add metrics

* les: moved ValueTracker inside ServerPool

* les: protect against node registration before server pool is started

* les/vflux/client: fixed tests

* les: make peer registration safe

* all: define Berlin hard fork spec

* rpc: add separate size limit for websocket (#22385)

This makes the WebSocket message size limit independent of the
limit used for HTTP requests. The new limit for WebSocket messages 
is 15MB.

* accounts/keystore: use github.com/google/uuid (#22217)

This replaces the github.com/pborman/uuid dependency with
github.com/google/uuid because the former is only a wrapper for
the latter (since v1.0.0).

Co-authored-by: Felix Lange <fjl@twurst.com>

* core/state: fix eta calculation on pruning (#22386)

* les: UDP pre-negotiation of available server capacity (#22183)

This PR implements the first one of the "lespay" UDP queries which
is already useful in itself: the capacity query. The server pool is making
use of this query by doing a cheap UDP query to determine whether it is
worth starting the more expensive TCP connection process.

* core/rawdb: fix the transaction indexer (#22395)

* core, eth: unship EIP 2315

* core/vm/runtime: more unshipping

* cmd/geth: put allowUnsecureTx flag in RPC section (#22412)

* params: update chts (#22418)

* cmd/utils: fix txlookuplimit for archive node (#22419)

* cmd/utils: fix exclusive check for archive node

* cmd/utils: set the txlookuplimit to 0

* core/forkid, params: unset Berlin fork number (#22413)

* les: fix nodiscover option on the client side (#22422)

* cmd: retire whisper flags (#22421)

* cmd: retire whisper flags

* cmd/geth: remove whisper configs

* tests: update to latest tests (#22290)

This updates the consensus tests to commit 31d6630 and
adds support for access list transactions in the test runner.

Co-authored-by: Martin Holst Swende <martin@swende.se>

* params: release geth 1.10.0 stable

* params: begin v1.10.1 release cycle

* Revert "core/forkid, params: unset Berlin fork number (#22413)"

This reverts commit ba99910.

* build: fix PPA failure due to updated debsrc

* build: add support for Ubuntu Hirsute Hippo

* tests: update reference tests with 2315 removed from Berlin

* params: release Geth v1.10.1

* params: begin v1.10.2 release cycle

* core/types: reduce allocations in GasPriceCmp (#22456)

* les: fix errors in metric namespace (#22459)

* les: add trailing slash to metric namespace

* les: omit '.' in metric namespace

* cmd: extend dumpgenesis to support network flags on the cmd (#22406)

* p2p/enr: fix decoding of incomplete lists (#22484)

Given a list of less than two elements DecodeRLP returned rlp.EOL,
leading to issues in outer decoders.

* cmd/geth: add ancient datadir flag to snapshot subcommands (#22486)

* cmd/devp2p: better testcase failure output for ethtests (#22482)

* eth, les: properly init statedb accesslist during tracing (#22480)

* eth/state, les/state: properly init statedb accesslist when tracing, fixes #22475

* eth: review comments

* eth/tracers: fix compilation err

* eth/tracers: apply @karalabe's suggested fix

* cmd/geth, eth/downloader: remove copydb command (#22501)

* cmd/geth: remove copydb command

* eth/downloader: remove fakepeer

* tests/fuzzers: fix goroutine leak in les fuzzer (#22455)

The oss-fuzz fuzzer has been reporting some failing testcases for les. They're all spurious, and cannot reliably be reproduced. However, running them showed that there was a goroutine leak: the tests created a lot of new clients, which started an exec queue that was never torn down.

This PR fixes the goroutine leak, and also a log message which was erroneously formatted.

* core/types: improve comments in new EIP-2718 code (#22402)

Responding to these comments:

    https://github.com/ethereum/go-ethereum/pull/21502/files#r579010962
    https://github.com/ethereum/go-ethereum/pull/21502/files#r579021565
    https://github.com/ethereum/go-ethereum/pull/21502/files#r579023510
    https://github.com/ethereum/go-ethereum/pull/21502/files#r578983734

* cmd/clef: docs - link to ethereum org repo (#22400)

* cmd/clef (docs): fix image background (#22399)

Flatten the image so we do not have dark text on dark background

* core/rawdb: fix transaction indexing/unindexing hashing error (#22457)

* core/rawdb: more verbose error logs + better hashing

* core/rawdb: add failing testcase

* core/rawdb: properly hash transactions while indexing/unindexing

* core/rawdb: exit on error + better log msg

* les: fix UDP connection query (#22451)

This PR fixes multiple issues with the UDP connection pre-negotiation feature:

- the enable condition was wrong (it checked the existence of the DiscV5 struct where it wasn't initialized yet, disabling the feature even if discv5 was enabled)
- the server pool queried already connected nodes when the discovery iterators returned them again
- servers responded positively before they were synced and really willing to accept connections

Metrics are also added on the server side that count the positive and negative replies to served connection queries.

* les: fix UDP connection query (#22451)

This PR fixes multiple issues with the UDP connection pre-negotiation feature:
- the enable condition was wrong (it checked the existence of the DiscV5 struct where it wasn't initialized yet, disabling the feature even if discv5 was enabled)
- the server pool queried already connected nodes when the discovery iterators returned them again
- servers responded positively before they were synced and really willing to accept connections

Metrics are also added on the server side that count the positive and negative replies to served connection queries.

* les: allow either full enode strings or raw hex ids in the API (#22423)

* eth/protocols/snap, eth/downloader: don't use bloom filter in snap sync

* eth/protocols/snap: fix typo (#22530)

* cmd/devp2p/internal/ethtest: return request ID in BlockHeaders response (#22508)

This PR fixes an issue with the eth66 test suite where, during a readAndServe when
the test is manually responding to GetBlockHeader requests, it now responds
with a BlockHeaders eth66 packet that includes the inbound request ID.

* ethclient: fix error handling for header test (#22514)

The wantErr field was disused, and the error returned by HeaderByNumber
was not properly tested.

This simplifies the error checking using errors.Is and asserts that getting
an expected missing header returns ethereum.NotFound. Also adds a nil
check condition for header.Number before using big.Int's Sign method.

* accounts/abi/bind: add NoSend transact option (#22446)

This adds a new option to avoid sending the transaction which is
created by calling a bound contract method.

* go.mod: upgrade goleveldb to commit 64b5b1c (#22436)

This pulls in a fix for a corruption issue when the process crashes
while a new manifest file is being added.

* go.mod: upgrade goupnp to commit 0ca76305 (#22479)

This pulls in a fix to skip the broadcast on interfaces which are down.

* consensus/ethash: remove unnecessary variable definition (#22512)

* cmd/devp2p: use AWS-SDK v2 (#22360)

This updates the DNS deployer to use AWS SDK v2. Migration is relatively
seamless, although there were two locations that required a slightly
different approach to achieve the same results. In particular, waiting for
DNS change propagation is very different with SDK v2. 

This change also optimizes DNS updates by publishing all changes before
waiting for propagation.

* p2p/dnsdisc: fix flaw in dns size calculation (#22533)

This fixes the calculation of the tree branch factor. With the new
formula, we now creat at most 13 children instead of 30, ensuring
the TXT record size will be below 370 bytes.

* core: fix potential race in chainIndexerTest (#22346)

* cmd/devp2p/internal/ethtest: skip eth/66 tests when v66 not supported (#22460)

* cmd/devp2p: add flag for AWS region (#22537)

* cmd/devp2p: fix error in updating the cursor when collecting records for route53 (#22538)

This PR fixes a regression introduced in #22360, when we updated to the v2 of the AWS sdk, which causes current crawler to just get the same first 100 results over and over, and get stuck in a loop.

* cmd/devp2p: add old block announcement test to eth test suite (#22474)

Add old block announcement test to eth test suite, checks to make sure old block announcement isn't propagated

* cmd/utils: fix compilation issue on openbsd (#22511)

* core: fix method comment for `txpool.requestReset` (#22543)

* accounts: eip-712 signing for ledger (#22378)

* accounts: eip-712 signing for ledger

* address review comments

* all: add read-only option to database (#22407)

* all: add read-only option to database

* all: fixes tests

* cmd/geth: migrate flags

* cmd/geth: fix the compact

* cmd/geth: fix the format

* cmd/geth: fix log

* cmd: add chain-readonly

* core: add readonly notion to freezer

* core/rawdb: add log

* core/rawdb: fix freezer close

* cmd: fix

* cmd, core: construct db

* core: update tests

* cmd/geth: check block range against chain head in export cmd (#22387)

Check the input parameters against the actual head block, exit on error

* core/state/snapshot: fix panic on missing parent

* internal/web3ext, node: migrate node admin API (Start|Stop)RPC->HTTP (#22461)

* internal/web3ext,node: migrate node admin API (Start|Stop)RPC->HTTP

Corresponding CLI flags --rpc have been moved to --http.

This moves the admin module HTTP RPC start/stop
methods to an equivalent namespace.

Rel ethereum/go-ethereum#22263

Date: 2021-03-08 08:00:11-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* internal/web3ext: fix startRPC/HTTP param count (4->5)

Date: 2021-03-16 06:13:23-05:00
Signed-off-by: meows <b5c6@protonmail.com>

* cmd/devp2p: skip ENR field tails properly in nodeset filter (#22565)

In Geth v1.10, we changed the structure of the "les" ENR entry. As a result, the DHT crawler that creates the DNS lists
no longer recognizes the les nodes, which is fixed in this commit. 

* cmd/devp2p: skip ENR field tails properly in nodeset filter
* cmd/devp2p: fix tail decoder for snap as well
* les: fix tail decoding in "eth" ENR entry

* p2p: fix minor typo and remove fd parameter in checkInboundConn (#22547)

* p2p/dnsdisc: rate limit resolving before checking cache (#22566)

This makes the rate limit apply regardless of whether the node is
already cached.

* eth/protocols/snap: fix the flaws in the snap sync (#22553)

* eth/protocols/snap: fix snap sync

* eth/protocols/snap: fix tests

* eth: fix tiny

* eth: update tests

* eth: update tests

* core/state/snapshot: testcase for #22534

* eth/protocols/snap: fix boundary loss on full-but-proven range

* core/state/snapshot: lintfix

* eth: address comment

* eth: fix handler

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* eth/tracers, core: use scopecontext in tracers, provide statedb in capturestart (#22333)

Fixes the CaptureStart api to include the EVM, thus being able to set the statedb early on. This pr also exposes the struct we used internally in the interpreter to encapsulate the contract, mem, stack, rstack, so we pass it as a single struct to the tracer, and removes the error returns on the capture methods.

* core: fix condition on header verification

* cmd/devp2p: fix comparison of TXT record value (#22572)

* cmd/devp2p: fix comparison of TXT record value

The AWS API returns quoted DNS strings, so we must encode the new value
before comparing it against the existing record content.

* cmd/devp2p: add test

* cmd/devp2p: fix typo and rename val -> newValue

* eth: dump rpc gas cap and tx fee cap (#22574)

* eth/protocols, metrics, p2p: add handler performance metrics

* eth/protocols, metrics: use resetting histograms for rare packets

* eth: fix corner case in sync head determination (#21695)

This avoids synchronisation failures when the local header is ahead of
the local full block.

* cmd/geth, consensus/ethash: add support for --miner.notify.full flag (#22558)

The PR implements the --miner.notify.full flag that enables full pending block
notifications. When this flag is used, the block notifications sent to mining
endpoints contain the complete block header JSON instead of a work package
array.

Co-authored-by: AlexSSD7 <alexandersadovskyi7@protonmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* metrics/influxdb: don't push empty histograms, no measurement != 0

* eth/protocols/snap: add peer id and req id to the timeout logs

* cmd/devp2p: update to newer cloudflare API client (#22588)

This upgrades the cloudflare client dependency to v0.14.0. The new
version changes the API because all methods now require a context
parameter. This change also reduces the log level of the 'Skipping...'
message to debug, following a similar change in the AWS deployer.

* core/state/pruner: move the compaction out of the pruning procedure (#22579)

The main idea behind it is: the range compaction is very expensive
which can take a few hours to finish. During this long procedure,
a lot of exceptions can occur, e.g.
- Geth is killed manually
- Geth is killed because of machine crash
- etc

In order to minimize the effect of the exceptions, the compaction
is moved out of the pruning. So that even the compaction is not
finished, the pruning is regarded as done.

* eth/protocols/snap: try to prevent requests timing out

* core: add BlockGen.GetBalance method  (#22589)

* cmd/puppeth: specify working directory for nodejs 15 (#22549)

* cmd/geth: add db dumptrie command (#22563)

Adds the command "geth db dumptrie <root> <seek> <max>", to better help investigate the trie data

* core/vm: fix Byzantium address list (#22603)

* ethstats: avoid creating subscriptions on background goroutine (#22587)

This fixes an issue where the ethstats service could crash if geth was
started and then immediately stopped due to an internal error. The
cause of the crash was a nil subscription being returned by the backend,
because the background goroutine creating them was scheduled after
the backend had already shut down.

Moving the creation of subscriptions into the Start method, which runs
synchronously during startup of the node, means the returned subscriptions
can never be 'nil'.

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* core/state/snapshot, ethdb: track deletions more accurately (#22582)

* core/state/snapshot, ethdb: track deletions more accurately

* core/state/snapshot: don't reset the iterator, leveldb's screwy

* ethdb: don't mess with the insert batches for now

* rpc: tighter shutdown synchronization in client subscription (#22597)

This fixes a rare issue where the client subscription forwarding loop
would attempt send on the subscription's channel after Unsubscribe has
returned, leading to a panic if the subscription channel was already
closed by the user. Example:

    sub, _ := client.Subscribe(..., channel, ...)
    sub.Unsubscribe()
    close(channel)

The race occurred because Unsubscribe called quitWithServer to tell the
forwarding loop to stop sending on sub.channel, but did not wait for the
loop to actually come down. This is fixed by adding an additional channel
to track the shutdown, on which Unsubscribe now waits.

Fixes #22322

* all: fix miner hashRate -> hashrate on API calls

* core/state/snapshot: fix data race in diff layer (#22540)

* internal/ethapi: fix eth_chainId method (#22243)

This removes the duplicated definition of eth_chainID
in package eth and updates the definition in internal/ethapi
to treat chain ID as a bigint.

Co-authored-by: Felix Lange <fjl@twurst.com>

* graphql: add support for tx types and tx access lists (#22491)

This adds support for EIP-2718 access list transactions in the GraphQL API.

Co-authored-by: Amit Shah <amitshah0t7@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>

* internal/debug: add JSON log format and rename logging flags (#22341)

This change adds support for logging JSON records when the --log.json flag is
given. The --debug and --backtrace flags are deprecated and replaced by
--log.debug and --log.backtrace.

While changing this, it was noticed that the --memprofilerate and
--blockprofilerate were ineffective (they were always overridden even if
--pprof.memprofilerate was not set). This is also fixed.

Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd/utils: move cache sanity check to SetEthConfig (#22510)

Move the cache sanity check to the SetEthConfig function
to allow the config file to load.

* consensus/ethash: replace a magic number with it's constant (#22618)

* les: move client pool to les/vflux/server (#22495)

* les: move client pool to les/vflux/server

* les/vflux/server: un-expose NodeBalance, remove unused fn, fix bugs

* tests/fuzzers/vflux: add ClientPool fuzzer

* les/vflux/server: fixed balance tests

* les: rebase fix

* les/vflux/server: fixed more bugs

* les/vflux/server: unexported NodeStateMachine fields and flags

* les/vflux/server: unexport all internal components and functions

* les/vflux/server: fixed priorityPool test

* les/vflux/server: polish balance

* les/vflux/server: fixed mutex locking error

* les/vflux/server: priorityPool bug fixed

* common/prque: make Prque wrap-around priority handling optional

* les/vflux/server: rename funcs, small optimizations

* les/vflux/server: fixed timeUntil

* les/vflux/server: separated balance.posValue and negValue

* les/vflux/server: polish setup

* les/vflux/server: enforce capacity curve monotonicity

* les/vflux/server: simplified requestCapacity

* les/vflux/server: requestCapacity with target range, no iterations in SetCapacity

* les/vflux/server: minor changes

* les/vflux/server: moved default factors to balanceTracker

* les/vflux/server: set inactiveFlag in priorityPool

* les/vflux/server: moved related metrics to vfs package

* les/vflux/client: make priorityPool temp state logic cleaner

* les/vflux/server: changed log.Crit to log.Error

* add vflux fuzzer to oss-fuzz

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* eth, les: fix tracers (#22473)

* eth, les: fix tracer

* eth: isolate live trie database in tracer

* eth: fix nil

* eth: fix

* eth, les: add checkLive param

* eth/tracer: fix

* core, eth, internal/ethapi: create access list RPC API (#22550)

* core/vm: implement AccessListTracer

* eth: implement debug.createAccessList

* core/vm: fixed nil panics in accessListTracer

* eth: better error messages for createAccessList

* eth: some fixes on CreateAccessList

* eth: allow for provided accesslists

* eth: pass accesslist by value

* eth: remove created acocunt from accesslist

* core/vm: simplify access list tracer

* core/vm: unexport accessListTracer

* eth: return best guess if al iteration times out

* eth: return best guess if al iteration times out

* core: docstring, unexport methods

* eth: typo

* internal/ethapi: move createAccessList to eth package

* internal/ethapi: remove reexec from createAccessList

* internal/ethapi: break if al is equal to last run, not if gas is equal

* internal/web3ext: fixed arguments

* core/types: fixed equality check for accesslist

* core/types: no hardcoded vals

* core, internal: simplify access list generation, make it precise

* core/vm: fix typo

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* eth: fix tracing state retrieval if requesting the non-dirty genesis

* params: update CHTs for v1.10.2

* params: release go-ethereum v1.10.2 stable

* Merge branch 'master' into upgrade/go-ethereum/v1.10.2-2022428043256

* Merge branch 'master' into upgrade/go-ethereum/v1.10.2-2022428043256

* Merge branch 'master' into upgrade/go-ethereum/v1.10.2-2022428043256

* Merge branch 'master' into upgrade/go-ethereum/v1.10.2-2022519080100

* fixes: diffs, todos done

* fix: tracers

* fix: tracers

* fix: quorum precompile contracts

* remove note book

* diff fixes: private db prepare, api result
other minor changes

* fix: revert diff

* remove useless warning

* fix diffs

* fix: merge

* fix: merge, diff

* revert unwanted modification
tag goquorum additions

* Update eth/api_backend.go

* Update eth/api_backend.go

* update state_accessor.go

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Dan DeGreef <dan.degreef@gmail.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Alex Mazalov <mazalov@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: ucwong <ucwong@126.com>
Co-authored-by: meowsbits <b5c6@protonmail.com>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: Łukasz Zimnoch <lukaszzimnoch1994@gmail.com>
Co-authored-by: ligi <ligi@ligi.de>
Co-authored-by: rene <41963722+renaynay@users.noreply.github.com>
Co-authored-by: Melvin Junhee Woo <melvin.woo@groundx.xyz>
Co-authored-by: Guillaume Ballet <gballet@gmail.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: Alex Prut <1648497+alexprut@users.noreply.github.com>
Co-authored-by: isdyaufh8o7cq <sebaskil@icloud.com>
Co-authored-by: Or Neeman <oneeman@gmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: michael1011 <me@michael1011.at>
Co-authored-by: wuff1996 <33193253+wuff1996@users.noreply.github.com>
Co-authored-by: Martin Redmond <21436+reds@users.noreply.github.com>
Co-authored-by: jacksoom <lifengliu1994@gmail.com>
Co-authored-by: Quest Henkart <qhenkart@gmail.com>
Co-authored-by: Tobias Hildebrandt <79341166+tobias-hildebrandt@users.noreply.github.com>
Co-authored-by: Derek Chiang <me@derekchiang.com>
Co-authored-by: MrChico <martin.lundfall@protonmail.com>
Co-authored-by: Chen Quan <terasum@163.com>
Co-authored-by: Zou Guangxian <zouguangxian@gmail.com>
Co-authored-by: AlexSSD7 <alexandersadovskyi7@protonmail.com>
Co-authored-by: nebojsa94 <nebojsa94@users.noreply.github.com>
Co-authored-by: Edgar Aroutiounian <edgar.factorial@gmail.com>
Co-authored-by: piersy <pierspowlesland@gmail.com>
Co-authored-by: AmitBRD <60668103+AmitBRD@users.noreply.github.com>
Co-authored-by: Amit Shah <amitshah0t7@gmail.com>
Co-authored-by: Peter Simard <petesimard56@gmail.com>
Co-authored-by: Evolution404 <35091674+Evolution404@users.noreply.github.com>
Co-authored-by: baptiste-b-pegasys <85155432+baptiste-b-pegasys@users.noreply.github.com>
Co-authored-by: Baptiste Boussemart <baptiste.boussemart@consensys.net>
Co-authored-by: achraf17 <achrafsellami0@gmail.com>
Co-authored-by: achraf <achraf.sellami@consensys.net>
antonydenyer pushed a commit to Consensys/quorum that referenced this pull request Aug 23, 2022
* eth: implement eth66 (#22241)

* eth/protocols/eth: split up the eth protocol handlers

* eth/protocols/eth: define eth-66 protocol messages

* eth/protocols/eth: poc implement getblockheaders on eth/66

* eth/protocols/eth: implement remaining eth-66 handlers

* eth/protocols: define handler map for eth 66

* eth/downloader: use protocol constants from eth package

* eth/protocols/eth: add ETH66 capability

* eth/downloader: tests for eth66

* eth/downloader: fix error in tests

* eth/protocols/eth: use eth66 for outgoing requests

* eth/protocols/eth: remove unused error type

* eth/protocols/eth: define protocol length

* eth/protocols/eth: fix pooled tx over eth66

* protocols/eth/handlers: revert behavioural change which caused tests to fail

* eth/downloader: fix failing test

* eth/protocols/eth: add testcases + fix flaw with header requests

* eth/protocols: change comments

* eth/protocols/eth: review fixes + fixed flaw in RequestOneHeader

* eth/protocols: documentation

* eth/protocols/eth: review concerns about types

* p2p/dnsdisc: fix hot-spin when all trees are empty (#22313)

In the random sync algorithm used by the DNS node iterator, we first pick a random
tree and then perform one sync action on that tree. This happens in a loop until any
node is found. If no trees contain any nodes, the iterator will enter a hot loop spinning
at 100% CPU.

The fix is complicated. The iterator now checks if a meaningful sync action can
be performed on any tree. If there is nothing to do, it waits for the next root record
recheck time to arrive and then tries again.

Fixes #22306

* les: renamed lespay to vflux (#22347)

* cmd/utils: disable caching preimages by default

* travis, appveyor, build: bump Go to 1.16

* les: fix balance expiration (#22343)

* les/lespay/server: fix balance expiration and add test

* les: move client balances to a new db

* les: rename lespayDb to lesDb

* tests/fuzzers/les: add fuzzer for les server handler (#22282)

* les: refactored server handler

* tests/fuzzers/les: add fuzzer for les server handler

* tests, les: update les fuzzer

tests: update les fuzzer

tests/fuzzer/les: release resources

tests/fuzzer/les: pre-initialize all resources

* les: refactored server handler and fuzzer

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* les: clean up server handler (#22357)

* cmd/geth: add db commands stats, compact, put, get, delete (#22014)

This PR introduces:

- db.put to put a value into the database
- db.get to read a value from the database
- db.delete to delete a value from the database
- db.stats to check compaction info from the database
- db.compact to trigger a db compaction

It also moves inspectdb to db.inspect.

* internal/ethapi: reject non-replay-protected txs over RPC (#22339)

This PR prevents users from submitting transactions without EIP-155 enabled. This behaviour can be overridden by specifying the flag --rpc.allow-unprotected-txs=true.

* accounts/abi/bind: fix up Go mod files for Go 1.16

* Dockerfile: bump to Go 1.16 base images

* travis: bump Android NDK version

* travis: bump builders to Bionic

* travis: manually install Android since Travis is stale (#22373)

* cmd/utils: remove deprecated command line flags (#22263)

This removes support for all deprecated flags except --rpc*.

* eth/protocols/snap: lower abortion and resumption logs to debug

* cmd, eth, les: enable serving light clients when non-synced (#22250)

This PR adds a more CLI flag, so that the les-server can serve light clients even the local node is not synced yet.

This functionality is needed in some testing environments(e.g. hive). After launching the les server, no more blocks will be imported so the node is always marked as "non-synced".

* les, light: improve txstatus retrieval (#22349)

Transaction unindexing will be enabled by default as of 1.10, which causes tx status retrieval will be broken without this PR. 

This PR introduces a retry mechanism in TxStatus retrieval.

* all: add support for EIP-2718, EIP-2930 transactions (#21502)

This adds support for EIP-2718 typed transactions as well as EIP-2930
access list transactions (tx type 1). These EIPs are scheduled for the
Berlin fork.

There very few changes to existing APIs in core/types, and several new APIs
to deal with access list transactions. In particular, there are two new
constructor functions for transactions: types.NewTx and types.SignNewTx.
Since the canonical encoding of typed transactions is not RLP-compatible,
Transaction now has new methods for encoding and decoding: MarshalBinary
and UnmarshalBinary.

The existing EIP-155 signer does not support the new transaction types.
All code dealing with transaction signatures should be updated to use the
newer EIP-2930 signer. To make this easier for future updates, we have
added new constructor functions for types.Signer: types.LatestSigner and
types.LatestSignerForChainID. 

This change also adds support for the YoloV3 testnet.

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* cmd/devp2p: add eth66 test suite (#22363)

Co-authored-by: Martin Holst Swende <martin@swende.se>

* les: move server pool to les/vflux/client (#22377)

* les: move serverPool to les/vflux/client

* les: add metrics

* les: moved ValueTracker inside ServerPool

* les: protect against node registration before server pool is started

* les/vflux/client: fixed tests

* les: make peer registration safe

* all: define Berlin hard fork spec

* rpc: add separate size limit for websocket (#22385)

This makes the WebSocket message size limit independent of the
limit used for HTTP requests. The new limit for WebSocket messages 
is 15MB.

* accounts/keystore: use github.com/google/uuid (#22217)

This replaces the github.com/pborman/uuid dependency with
github.com/google/uuid because the former is only a wrapper for
the latter (since v1.0.0).

Co-authored-by: Felix Lange <fjl@twurst.com>

* core/state: fix eta calculation on pruning (#22386)

* les: UDP pre-negotiation of available server capacity (#22183)

This PR implements the first one of the "lespay" UDP queries which
is already useful in itself: the capacity query. The server pool is making
use of this query by doing a cheap UDP query to determine whether it is
worth starting the more expensive TCP connection process.

* core/rawdb: fix the transaction indexer (#22395)

* core, eth: unship EIP 2315

* core/vm/runtime: more unshipping

* cmd/geth: put allowUnsecureTx flag in RPC section (#22412)

* params: update chts (#22418)

* cmd/utils: fix txlookuplimit for archive node (#22419)

* cmd/utils: fix exclusive check for archive node

* cmd/utils: set the txlookuplimit to 0

* core/forkid, params: unset Berlin fork number (#22413)

* les: fix nodiscover option on the client side (#22422)

* cmd: retire whisper flags (#22421)

* cmd: retire whisper flags

* cmd/geth: remove whisper configs

* tests: update to latest tests (#22290)

This updates the consensus tests to commit 31d6630 and
adds support for access list transactions in the test runner.

Co-authored-by: Martin Holst Swende <martin@swende.se>

* params: release geth 1.10.0 stable

* params: begin v1.10.1 release cycle

* Revert "core/forkid, params: unset Berlin fork number (#22413)"

This reverts commit ba99910.

* build: fix PPA failure due to updated debsrc

* build: add support for Ubuntu Hirsute Hippo

* tests: update reference tests with 2315 removed from Berlin

* params: release Geth v1.10.1

* params: begin v1.10.2 release cycle

* core/types: reduce allocations in GasPriceCmp (#22456)

* les: fix errors in metric namespace (#22459)

* les: add trailing slash to metric namespace

* les: omit '.' in metric namespace

* cmd: extend dumpgenesis to support network flags on the cmd (#22406)

* p2p/enr: fix decoding of incomplete lists (#22484)

Given a list of less than two elements DecodeRLP returned rlp.EOL,
leading to issues in outer decoders.

* cmd/geth: add ancient datadir flag to snapshot subcommands (#22486)

* cmd/devp2p: better testcase failure output for ethtests (#22482)

* eth, les: properly init statedb accesslist during tracing (#22480)

* eth/state, les/state: properly init statedb accesslist when tracing, fixes #22475

* eth: review comments

* eth/tracers: fix compilation err

* eth/tracers: apply @karalabe's suggested fix

* cmd/geth, eth/downloader: remove copydb command (#22501)

* cmd/geth: remove copydb command

* eth/downloader: remove fakepeer

* tests/fuzzers: fix goroutine leak in les fuzzer (#22455)

The oss-fuzz fuzzer has been reporting some failing testcases for les. They're all spurious, and cannot reliably be reproduced. However, running them showed that there was a goroutine leak: the tests created a lot of new clients, which started an exec queue that was never torn down.

This PR fixes the goroutine leak, and also a log message which was erroneously formatted.

* core/types: improve comments in new EIP-2718 code (#22402)

Responding to these comments:

    https://github.com/ethereum/go-ethereum/pull/21502/files#r579010962
    https://github.com/ethereum/go-ethereum/pull/21502/files#r579021565
    https://github.com/ethereum/go-ethereum/pull/21502/files#r579023510
    https://github.com/ethereum/go-ethereum/pull/21502/files#r578983734

* cmd/clef: docs - link to ethereum org repo (#22400)

* cmd/clef (docs): fix image background (#22399)

Flatten the image so we do not have dark text on dark background

* core/rawdb: fix transaction indexing/unindexing hashing error (#22457)

* core/rawdb: more verbose error logs + better hashing

* core/rawdb: add failing testcase

* core/rawdb: properly hash transactions while indexing/unindexing

* core/rawdb: exit on error + better log msg

* les: fix UDP connection query (#22451)

This PR fixes multiple issues with the UDP connection pre-negotiation feature:

- the enable condition was wrong (it checked the existence of the DiscV5 struct where it wasn't initialized yet, disabling the feature even if discv5 was enabled)
- the server pool queried already connected nodes when the discovery iterators returned them again
- servers responded positively before they were synced and really willing to accept connections

Metrics are also added on the server side that count the positive and negative replies to served connection queries.

* les: fix UDP connection query (#22451)

This PR fixes multiple issues with the UDP connection pre-negotiation feature:
- the enable condition was wrong (it checked the existence of the DiscV5 struct where it wasn't initialized yet, disabling the feature even if discv5 was enabled)
- the server pool queried already connected nodes when the discovery iterators returned them again
- servers responded positively before they were synced and really willing to accept connections

Metrics are also added on the server side that count the positive and negative replies to served connection queries.

* les: allow either full enode strings or raw hex ids in the API (#22423)

* eth/protocols/snap, eth/downloader: don't use bloom filter in snap sync

* eth/protocols/snap: fix typo (#22530)

* cmd/devp2p/internal/ethtest: return request ID in BlockHeaders response (#22508)

This PR fixes an issue with the eth66 test suite where, during a readAndServe when
the test is manually responding to GetBlockHeader requests, it now responds
with a BlockHeaders eth66 packet that includes the inbound request ID.

* ethclient: fix error handling for header test (#22514)

The wantErr field was disused, and the error returned by HeaderByNumber
was not properly tested.

This simplifies the error checking using errors.Is and asserts that getting
an expected missing header returns ethereum.NotFound. Also adds a nil
check condition for header.Number before using big.Int's Sign method.

* accounts/abi/bind: add NoSend transact option (#22446)

This adds a new option to avoid sending the transaction which is
created by calling a bound contract method.

* go.mod: upgrade goleveldb to commit 64b5b1c (#22436)

This pulls in a fix for a corruption issue when the process crashes
while a new manifest file is being added.

* go.mod: upgrade goupnp to commit 0ca76305 (#22479)

This pulls in a fix to skip the broadcast on interfaces which are down.

* consensus/ethash: remove unnecessary variable definition (#22512)

* cmd/devp2p: use AWS-SDK v2 (#22360)

This updates the DNS deployer to use AWS SDK v2. Migration is relatively
seamless, although there were two locations that required a slightly
different approach to achieve the same results. In particular, waiting for
DNS change propagation is very different with SDK v2. 

This change also optimizes DNS updates by publishing all changes before
waiting for propagation.

* p2p/dnsdisc: fix flaw in dns size calculation (#22533)

This fixes the calculation of the tree branch factor. With the new
formula, we now creat at most 13 children instead of 30, ensuring
the TXT record size will be below 370 bytes.

* core: fix potential race in chainIndexerTest (#22346)

* cmd/devp2p/internal/ethtest: skip eth/66 tests when v66 not supported (#22460)

* cmd/devp2p: add flag for AWS region (#22537)

* cmd/devp2p: fix error in updating the cursor when collecting records for route53 (#22538)

This PR fixes a regression introduced in #22360, when we updated to the v2 of the AWS sdk, which causes current crawler to just get the same first 100 results over and over, and get stuck in a loop.

* cmd/devp2p: add old block announcement test to eth test suite (#22474)

Add old block announcement test to eth test suite, checks to make sure old block announcement isn't propagated

* cmd/utils: fix compilation issue on openbsd (#22511)

* core: fix method comment for `txpool.requestReset` (#22543)

* accounts: eip-712 signing for ledger (#22378)

* accounts: eip-712 signing for ledger

* address review comments

* all: add read-only option to database (#22407)

* all: add read-only option to database

* all: fixes tests

* cmd/geth: migrate flags

* cmd/geth: fix the compact

* cmd/geth: fix the format

* cmd/geth: fix log

* cmd: add chain-readonly

* core: add readonly notion to freezer

* core/rawdb: add log

* core/rawdb: fix freezer close

* cmd: fix

* cmd, core: construct db

* core: update tests

* cmd/geth: check block range against chain head in export cmd (#22387)

Check the input parameters against the actual head block, exit on error

* core/state/snapshot: fix panic on missing parent

* internal/web3ext, node: migrate node admin API (Start|Stop)RPC->HTTP (#22461)

* internal/web3ext,node: migrate node admin API (Start|Stop)RPC->HTTP

Corresponding CLI flags --rpc have been moved to --http.

This moves the admin module HTTP RPC start/stop
methods to an equivalent namespace.

Rel ethereum/go-ethereum#22263

Date: 2021-03-08 08:00:11-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* internal/web3ext: fix startRPC/HTTP param count (4->5)

Date: 2021-03-16 06:13:23-05:00
Signed-off-by: meows <b5c6@protonmail.com>

* cmd/devp2p: skip ENR field tails properly in nodeset filter (#22565)

In Geth v1.10, we changed the structure of the "les" ENR entry. As a result, the DHT crawler that creates the DNS lists
no longer recognizes the les nodes, which is fixed in this commit. 

* cmd/devp2p: skip ENR field tails properly in nodeset filter
* cmd/devp2p: fix tail decoder for snap as well
* les: fix tail decoding in "eth" ENR entry

* p2p: fix minor typo and remove fd parameter in checkInboundConn (#22547)

* p2p/dnsdisc: rate limit resolving before checking cache (#22566)

This makes the rate limit apply regardless of whether the node is
already cached.

* eth/protocols/snap: fix the flaws in the snap sync (#22553)

* eth/protocols/snap: fix snap sync

* eth/protocols/snap: fix tests

* eth: fix tiny

* eth: update tests

* eth: update tests

* core/state/snapshot: testcase for #22534

* eth/protocols/snap: fix boundary loss on full-but-proven range

* core/state/snapshot: lintfix

* eth: address comment

* eth: fix handler

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* eth/tracers, core: use scopecontext in tracers, provide statedb in capturestart (#22333)

Fixes the CaptureStart api to include the EVM, thus being able to set the statedb early on. This pr also exposes the struct we used internally in the interpreter to encapsulate the contract, mem, stack, rstack, so we pass it as a single struct to the tracer, and removes the error returns on the capture methods.

* core: fix condition on header verification

* cmd/devp2p: fix comparison of TXT record value (#22572)

* cmd/devp2p: fix comparison of TXT record value

The AWS API returns quoted DNS strings, so we must encode the new value
before comparing it against the existing record content.

* cmd/devp2p: add test

* cmd/devp2p: fix typo and rename val -> newValue

* eth: dump rpc gas cap and tx fee cap (#22574)

* eth/protocols, metrics, p2p: add handler performance metrics

* eth/protocols, metrics: use resetting histograms for rare packets

* eth: fix corner case in sync head determination (#21695)

This avoids synchronisation failures when the local header is ahead of
the local full block.

* cmd/geth, consensus/ethash: add support for --miner.notify.full flag (#22558)

The PR implements the --miner.notify.full flag that enables full pending block
notifications. When this flag is used, the block notifications sent to mining
endpoints contain the complete block header JSON instead of a work package
array.

Co-authored-by: AlexSSD7 <alexandersadovskyi7@protonmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* metrics/influxdb: don't push empty histograms, no measurement != 0

* eth/protocols/snap: add peer id and req id to the timeout logs

* cmd/devp2p: update to newer cloudflare API client (#22588)

This upgrades the cloudflare client dependency to v0.14.0. The new
version changes the API because all methods now require a context
parameter. This change also reduces the log level of the 'Skipping...'
message to debug, following a similar change in the AWS deployer.

* core/state/pruner: move the compaction out of the pruning procedure (#22579)

The main idea behind it is: the range compaction is very expensive
which can take a few hours to finish. During this long procedure,
a lot of exceptions can occur, e.g.
- Geth is killed manually
- Geth is killed because of machine crash
- etc

In order to minimize the effect of the exceptions, the compaction
is moved out of the pruning. So that even the compaction is not
finished, the pruning is regarded as done.

* eth/protocols/snap: try to prevent requests timing out

* core: add BlockGen.GetBalance method  (#22589)

* cmd/puppeth: specify working directory for nodejs 15 (#22549)

* cmd/geth: add db dumptrie command (#22563)

Adds the command "geth db dumptrie <root> <seek> <max>", to better help investigate the trie data

* core/vm: fix Byzantium address list (#22603)

* ethstats: avoid creating subscriptions on background goroutine (#22587)

This fixes an issue where the ethstats service could crash if geth was
started and then immediately stopped due to an internal error. The
cause of the crash was a nil subscription being returned by the backend,
because the background goroutine creating them was scheduled after
the backend had already shut down.

Moving the creation of subscriptions into the Start method, which runs
synchronously during startup of the node, means the returned subscriptions
can never be 'nil'.

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* core/state/snapshot, ethdb: track deletions more accurately (#22582)

* core/state/snapshot, ethdb: track deletions more accurately

* core/state/snapshot: don't reset the iterator, leveldb's screwy

* ethdb: don't mess with the insert batches for now

* rpc: tighter shutdown synchronization in client subscription (#22597)

This fixes a rare issue where the client subscription forwarding loop
would attempt send on the subscription's channel after Unsubscribe has
returned, leading to a panic if the subscription channel was already
closed by the user. Example:

    sub, _ := client.Subscribe(..., channel, ...)
    sub.Unsubscribe()
    close(channel)

The race occurred because Unsubscribe called quitWithServer to tell the
forwarding loop to stop sending on sub.channel, but did not wait for the
loop to actually come down. This is fixed by adding an additional channel
to track the shutdown, on which Unsubscribe now waits.

Fixes #22322

* all: fix miner hashRate -> hashrate on API calls

* core/state/snapshot: fix data race in diff layer (#22540)

* internal/ethapi: fix eth_chainId method (#22243)

This removes the duplicated definition of eth_chainID
in package eth and updates the definition in internal/ethapi
to treat chain ID as a bigint.

Co-authored-by: Felix Lange <fjl@twurst.com>

* graphql: add support for tx types and tx access lists (#22491)

This adds support for EIP-2718 access list transactions in the GraphQL API.

Co-authored-by: Amit Shah <amitshah0t7@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>

* internal/debug: add JSON log format and rename logging flags (#22341)

This change adds support for logging JSON records when the --log.json flag is
given. The --debug and --backtrace flags are deprecated and replaced by
--log.debug and --log.backtrace.

While changing this, it was noticed that the --memprofilerate and
--blockprofilerate were ineffective (they were always overridden even if
--pprof.memprofilerate was not set). This is also fixed.

Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd/utils: move cache sanity check to SetEthConfig (#22510)

Move the cache sanity check to the SetEthConfig function
to allow the config file to load.

* consensus/ethash: replace a magic number with it's constant (#22618)

* les: move client pool to les/vflux/server (#22495)

* les: move client pool to les/vflux/server

* les/vflux/server: un-expose NodeBalance, remove unused fn, fix bugs

* tests/fuzzers/vflux: add ClientPool fuzzer

* les/vflux/server: fixed balance tests

* les: rebase fix

* les/vflux/server: fixed more bugs

* les/vflux/server: unexported NodeStateMachine fields and flags

* les/vflux/server: unexport all internal components and functions

* les/vflux/server: fixed priorityPool test

* les/vflux/server: polish balance

* les/vflux/server: fixed mutex locking error

* les/vflux/server: priorityPool bug fixed

* common/prque: make Prque wrap-around priority handling optional

* les/vflux/server: rename funcs, small optimizations

* les/vflux/server: fixed timeUntil

* les/vflux/server: separated balance.posValue and negValue

* les/vflux/server: polish setup

* les/vflux/server: enforce capacity curve monotonicity

* les/vflux/server: simplified requestCapacity

* les/vflux/server: requestCapacity with target range, no iterations in SetCapacity

* les/vflux/server: minor changes

* les/vflux/server: moved default factors to balanceTracker

* les/vflux/server: set inactiveFlag in priorityPool

* les/vflux/server: moved related metrics to vfs package

* les/vflux/client: make priorityPool temp state logic cleaner

* les/vflux/server: changed log.Crit to log.Error

* add vflux fuzzer to oss-fuzz

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* eth, les: fix tracers (#22473)

* eth, les: fix tracer

* eth: isolate live trie database in tracer

* eth: fix nil

* eth: fix

* eth, les: add checkLive param

* eth/tracer: fix

* core, eth, internal/ethapi: create access list RPC API (#22550)

* core/vm: implement AccessListTracer

* eth: implement debug.createAccessList

* core/vm: fixed nil panics in accessListTracer

* eth: better error messages for createAccessList

* eth: some fixes on CreateAccessList

* eth: allow for provided accesslists

* eth: pass accesslist by value

* eth: remove created acocunt from accesslist

* core/vm: simplify access list tracer

* core/vm: unexport accessListTracer

* eth: return best guess if al iteration times out

* eth: return best guess if al iteration times out

* core: docstring, unexport methods

* eth: typo

* internal/ethapi: move createAccessList to eth package

* internal/ethapi: remove reexec from createAccessList

* internal/ethapi: break if al is equal to last run, not if gas is equal

* internal/web3ext: fixed arguments

* core/types: fixed equality check for accesslist

* core/types: no hardcoded vals

* core, internal: simplify access list generation, make it precise

* core/vm: fix typo

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* eth: fix tracing state retrieval if requesting the non-dirty genesis

* params: update CHTs for v1.10.2

* params: release go-ethereum v1.10.2 stable

* params: begin v1.10.3 release cycle

* eth, les: drop support for eth/64, fix eth/66 tests

* accounts: documentation fixes (#22645)

* replaces `an chance` with `a chance`
* replaces `SignHashWithPassphrase` with `SignTextWithPassphrase` as there was no SignHashWithPasspharse function in the file

* cmd/geth: add db-command to inspect freezer index (#22633)

This PR makes it easier to inspect the freezer index, which could be useful to investigate things like #22111

* cmd/faucet: support testnet flags in the faucet (#22545)


Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth/fetcher: avoid spurious timer events at startup (#22652)


Co-authored-by: Felix Lange <fjl@twurst.com>

* core, eth: faster snapshot generation (#22504)

* eth/protocols: persist received state segments

* core: initial implementation

* core/state/snapshot: add tests

* core, eth: updates

* eth/protocols/snapshot: count flat state size

* core/state: add metrics

* core/state/snapshot: skip unnecessary deletion

* core/state/snapshot: rename

* core/state/snapshot: use the global batch

* core/state/snapshot: add logs and fix wiping

* core/state/snapshot: fix

* core/state/snapshot: save generation progress even if the batch is empty

* core/state/snapshot: fixes

* core/state/snapshot: fix initial account range length

* core/state/snapshot: fix initial account range

* eth/protocols/snap: store flat states during the healing

* eth/protocols/snap: print logs

* core/state/snapshot: refactor (#4)

* core/state/snapshot: refactor

* core/state/snapshot: tiny fix and polish

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* core, eth: fixes

* core, eth: fix healing writer

* core, trie, eth: fix paths

* eth/protocols/snap: fix encoding

* eth, core: add debug log

* core/state/generate: release iterator asap (#5)

core/state/snapshot: less copy

core/state/snapshot: revert split loop

core/state/snapshot: handle storage becoming empty, improve test robustness

core/state: test modified codehash

core/state/snapshot: polish

* core/state/snapshot: optimize stats counter

* core, eth: add metric

* core/state/snapshot: update comments

* core/state/snapshot: improve tests

* core/state/snapshot: replace secure trie with standard trie

* core/state/snapshot: wrap return as the struct

* core/state/snapshot: skip wiping correct states

* core/state/snapshot: updates

* core/state/snapshot: fixes

* core/state/snapshot: fix panic due to reference flaw in closure

* core/state/snapshot: fix errors in state generation logic + fix log output

* core/state/snapshot: remove an error case

* core/state/snapshot: fix condition-check for exhausted snap state

* core/state/snapshot: use stackTrie for small tries

* core/state/snapshot: don't resolve small storage tries in vain

* core/state/snapshot: properly clean up storage of deleted accounts

* core/state/snapshot: avoid RLP-encoding in some cases + minor nitpicks

* core/state/snapshot: fix error (+testcase)

* core/state/snapshot: clean up tests a bit

* core/state/snapshot: work in progress on better tests

* core/state/snapshot: polish code

* core/state/snapshot: fix trie iteration abortion trigger

* core/state/snapshot: fixes flaws

* core/state/snapshot: remove panic

* core/state/snapshot: fix abort

* core/state/snapshot: more tests (plus failing testcase)

* core/state/snapshot: more testcases + fix for failing test

* core/state/snapshot: testcase for malformed data

* core/state/snapshot: some test nitpicks

* core/state/snapshot: improvements to logging

* core/state/snapshot: testcase to demo error in abortion

* core/state/snapshot: fix abortion

* cmd/geth: make verify-state report the root

* trie: fix failing test

* core/state/snapshot: add timer metrics

* core/state/snapshot: fix metrics

* core/state/snapshot: udpate tests

* eth/protocols/snap: write snapshot account even if code or state is needed

* core/state/snapshot: fix diskmore check

* core/state/snapshot: review fixes

* core/state/snapshot: improve error message

* cmd/geth: rename 'error' to 'err' in logs

* core/state/snapshot: fix some review concerns

* core/state/snapshot, eth/protocols/snap: clear snapshot marker when starting/resuming snap sync

* core: add error log

* core/state/snapshot: use proper timers for metrics collection

* core/state/snapshot: address some review concerns

* eth/protocols/snap: improved log message

* eth/protocols/snap: fix heal logs to condense infos

* core/state/snapshot: wait for generator termination before restarting

* core/state/snapshot: revert timers to counters to track total time

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* core/types: drop some relice data types

* all: make logs a bit easier on the eye to digest (#22665)

* all: add thousandths separators for big numbers on log messages

* p2p/sentry: drop accidental file

* common, log: add fast number formatter

* common, eth/protocols/snap: simplifty fancy num types

* log: handle nil big ints

* eth/protocols/snap: use ephemeral channels to avoid cross-sync delveries

* core: add TestGenesisHashes and fix YoloV3 (#22559)

This adds simple unit test checking if the hard-coded genesis
hash values in package params match the actual genesis block hashes.

* log: fix formatting of big.Int (#22679)

* log: fix formatting of big.Int

The implementation of formatLogfmtBigInt had two issues: it crashed when
the number was actually large enough to hit the big integer case, and
modified the big.Int while formatting it.

* log: don't call FormatLogfmtInt64 for int16

* log: separate from decimals back, not front

Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* les/vflux/server: fix priority cornercase causing fuzzer timeout (#22650)

* les/vflux/server: fix estimatePriority corner case

* les/vflux/server: simplify inactiveAllowance == 0 case

* trie: make stacktrie not mutate input values (#22673)

The stacktrie is a bit un-untuitive, API-wise: since it mutates input values.
Such behaviour is dangerous, and easy to get wrong if the calling code 'forgets' this quirk. The behaviour is fixed by this PR, so that the input values are not modified by the stacktrie. 

Note: just as with the Trie, the stacktrie still references the live input objects, so it's still _not_ safe to mutate the values form the callsite.

* core/state/snapshot: avoid copybytes for stacktrie

* eth/catalyst: add catalyst API prototype (#22641)

This change adds the --catalyst flag, enabling an RPC API for eth2 integration.
In this initial version, catalyst mode also disables all peer-to-peer networking.

Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd/devp2p: add support for -limit option in nodeset filter command (#22694)

The new -limit option makes the filter operate on top N nodes by score.
This also adds ENR attribute stats in the nodeset info command.
Node set commands are now documented in README.

* cmd/devp2p: add dns nuke-route53 command (#22695)

* core: nuke legacy snapshot supporting (#22663)

* ethash: no block reward in catalyst mode (#22697)

* trie: make stacktrie support binary marshal/unmarshal (#22685)

* go.mod: upgrade gopsutils to v3.21.4 (#22693)

This fixes the OpenBSD/arm64 build.

* tests: disable blockchain tests based on general state tests (#22704)

* eth, internal: extend the TraceCall API (#22245)

Adds an an optional parameter `overrides *map[common.Address]account` to the `eth_call` API in order for the caller to  can customize the state.

* eth/tracers, internal/ethapi: fix typos causing lint issue (#22711)

* les: fix goroutine leaks in tests (#22707)

* trie: improve the node iterator seek operation (#22470)

This change improves the efficiency of the nodeIterator seek
operation. Previously, seek essentially ran the iterator forward
until it found the matching node. With this change, it skips
over fullnode children and avoids resolving them from the database.

* accounts/external, signer/core: add support for EIP-2930 transactions (#22585)

This adds support for signing EIP-2930 with clef.

* rpc: add HTTPError type for HTTP error responses (#22677)

The new error type is returned by client operations contains details of
the response error code and response body.

Co-authored-by: Felix Lange <fjl@twurst.com>

* eth/protocols, prp/tracker: add support for req/rep rtt tracking (#22608)

* eth/protocols, prp/tracker: add support for req/rep rtt tracking

* p2p/tracker: sanity cap the number of pending requests

* pap/tracker: linter <3

* p2p/tracker: disable entire tracker if no metrics are enabled

* cmd/devp2p/internal/ethtest: run test suite as Go unit test (#22698)

This change adds a Go unit test that runs the protocol test suite
against the go-ethereum implementation of the eth protocol.

* core/state/snapshot, true: reuse dirty data instead of hitting disk when generating (#22667)

* core/state/snapshot: reuse memory data instead of hitting disk when generating

* trie: minor nitpicks wrt the resolver optimization

* core/state/snapshot, trie: use key/value store for resolver

* trie: fix linter

Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* cmd/devp2p/internal/ethtest: add more tx propagation tests (#22630)

This adds a test for large tx announcement messages, as well as a test to
check that announced tx hashes are requested by the node.

* p2p/discover: improve discv5 handling of IPv4-in-IPv6 addresses (#22703)

When receiving PING from an IPv4 address over IPv6, the implementation sent
back a IPv4-in-IPv6 address. This change makes it reflect the IPv4 address.

* core: remove old conversion to shuffle leveldb blocks into ancients

* core/rawdb: fix datarace in freezer (#22728)

The Append / truncate operations were racy. When a datafile reaches 2Gb, a new file is needed. For this operation, we require a writelock, which is not needed in the 99.99% of all cases where the data does fit in the current head-file.

This transition from readlock to writelock was incorrect, and as the readlock was released, a truncate operation could slip in between, and truncate the data. This would have been fine, however, the Append operation continued writing as if no truncation had occurred, e.g writing item 5 where item 0 should reside.

This PR changes the behaviour, so that if when we run into the situation that a new file is needed, it aborts, and retries, this time with a writelock.

The outcome of the situation described above, running on this PR, would instead be that the Append operation exits with a failure.

* les: polish code (#22625)

* les: polish code

* les/vflus/server: fixes

* les: fix lint

* build: upgrade to golangci-lint v1.39.0 (#22696)

* build: upgrade to golangci-lint v1.39.0

* consensus/ethash: fix go vet warning regarding reflect.SliceHeader

* eth/catalyst: fix lint issue

* consensus/ethash: fix bug in memoryMapFile

* cmd/puppeth: add support for authentication via ssh agent (#22634)

* build: upgrade -dlgo version to Go 1.16.3 (#22746)

* core/vm: make gas cost reporting to tracers correct (#22702)

Previously, the makeCallVariantGasCallEIP2929 charged the cold account access cost directly, leading to an incorrect gas cost passed to the tracer from the main execution loop.
This change still temporarily charges the cost (to allow for an accurate calculation of the available gas for the call), but then afterwards refunds it and instead returns the correct total gas cost to be then properly charged in the main loop.

* eth/protocols/snap: generate storage trie from full dirty snap data (#22668)

* eth/protocols/snap: generate storage trie from full dirty snap data

* eth/protocols/snap: get rid of some more dead code

* eth/protocols/snap: less frequent logs, also log during trie generation

* eth/protocols/snap: implement dirty account range stack-hashing

* eth/protocols/snap: don't loop on account trie generation

* eth/protocols/snap: fix account format in trie

* core, eth, ethdb: glue snap packets together, but not chunks

* eth/protocols/snap: print completion log for snap phase

* eth/protocols/snap: extended tests

* eth/protocols/snap: make testcase pass

* eth/protocols/snap: fix account stacktrie commit without defer

* ethdb: fix key counts on reset

* eth/protocols: fix typos

* eth/protocols/snap: make better use of delivered data (#44)

* eth/protocols/snap: make better use of delivered data

* squashme

* eth/protocols/snap: reduce chunking

* squashme

* eth/protocols/snap: reduce chunking further

* eth/protocols/snap: break out hash range calculations

* eth/protocols/snap: use sort.Search instead of looping

* eth/protocols/snap: prevent crash on storage response with no keys

* eth/protocols/snap: nitpicks all around

* eth/protocols/snap: clear heal need on 1-chunk storage completion

* eth/protocols/snap: fix range chunker, add tests

Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* trie: fix test API error

* eth/protocols/snap: fix some further liter issues

* eth/protocols/snap: fix accidental batch reuse

Co-authored-by: Martin Holst Swende <martin@swende.se>

* p2p/tracker: properly clean up fulfilled requests

* p2p/tracker: only reschedule wake if previous didn't run

* cmd/devp2p, eth/protocols/eth: fix tests + make sanity checks earlier (#22749)

* eth/gasprice: improve stability of estimated price (#22722)

This PR makes the gas price oracle ignore transactions priced at `<=1 wei`.

* tests/fuzzers: crypto/bn256 and crypto/bls12381 tests against gnark-crypto  (#22755)

Add more cross-fuzzers to fuzz bls with gnark versus geth's own bls12-381 library

* les, tests: fix les clientpool (#22756)

* les, tests: fix les clientpool

* tests: disable debug mode

* les: polish code

* eth/protocols/snap: lower the packet size to avoid overloading link

* cmd/devp2p: fix flaky SameRequestID test (#22754)

* trie: remove redundant returns + use stacktrie where applicable (#22760)

* trie: add benchmark for proofless range

* trie: remove unused returns + use stacktrie

* core, eth, ethdb, trie: simplify range proofs

* eth: restore eth_hashrate API endpoint

* catalyst: check if block exists in assemble-block call with unknown parent-hash (#22770)

* add myself as code owner for catalyst (#22778)

* docs: fix docstring on read head block (#22776)

* evm: remove unused errors left after EIP-2315 removal (#22767)

* github: add note about screenshots in issue template (#22764)

* core/types: add license header (#22781)

* core/vm: fix typo in comment (#22785)

* core: remove unused else branch in reorg (#22783)

* core/vm: replace repeated string with variable in tests (#22774)

* core: fix typo in comment (#22773)

* README.md: update commands table, add note about web3.js version (#22748)

* eth/filters: fix comment on PublicFilterAPI timeoutLoop (#22782)

* core/state: remove toAddr helper in tests (#22772)

* core, eth: abort snapshot generation on snap sync and resume later

* eth/protocols/snap: use storage batch, not account batch in st task

* cmd/devp2p: fix flakey tests in CI (#22757)

This PR fixes a couple of issues in the eth test suite that caused flakiness when run in the CI.

* core/vm: clean up contract creation error handling (#22766)

Do not keep separate flag for "max code size exceeded" case, but instead
assign appropriate error for it sooner.

* core/vm: fix interpreter comments (#22797)

* Fix interpreter comment

* Fix comment

* params: remove dependency on crypto (#22788)

* params: remove dependency on crypto

Package params should not depend on package crypto because building
crypto requires cgo.

Since build/ci.go needs package params to get the go-ethereum version
number, C code must be compiled in order to run the build tool, which is
annoying for certain cross-compilation setups.

* params: add SectionHead

* cmd/utils: don't crash on nonexistent datadir (#22738)

* eth: don't print db upgrade warning on db init

* cmd/utils: use eth DNS tree for snap discovery (#22808)

This removes auto-configuration of the snap.*.ethdisco.net DNS discovery tree.
Since measurements have shown that > 75% of nodes in all.*.ethdisco.net support
snap, we have decided to retire the dedicated index for snap and just use the eth
tree instead.

The dial iterators of eth and snap now use the same DNS tree in the default configuration,
so both iterators should use the same DNS discovery client instance. This ensures that
the record cache and rate limit are shared. Records will not be requested multiple times.

While testing the change, I noticed that duplicate DNS requests do happen even
when the client instance is shared. This is because the two iterators request the tree
root, link tree root, and first levels of the tree in lockstep. To avoid this problem, the
change also adds a singleflight.Group instance in the client. When one iterator
attempts to resolve an entry which is already being resolved, the singleflight object
waits for the existing resolve call to finish and returns the entry to both places.

* build: improve cross compilation setup (#22804)

This PR cleans up the CI build system and fixes a couple of issues.

- The go tool launcher code has been moved to internal/build. With the new
  toolchain functions, the environment of the host Go (i.e. the one that built
  ci.go) and the target Go (i.e. the toolchain downloaded by -dlgo) are isolated
  more strictly. This is important to make cross compilation and -dlgo work
  correctly in more cases.
- The -dlgo option now skips the download and uses the host Go if the running Go
  version matches dlgoVersion exactly.
- The 'test' command now supports -dlgo, -cc and -arch. Running unit tests with
  foreign GOARCH is occasionally useful. For example, it can be used to run
  32-bit tests on Windows. It can also be used to run darwin/amd64 tests on
  darwin/arm64 using Rosetta 2.
- The 'aar', 'xcode' and 'xgo' commands now use a slightly different method to
  install external tools. They previously used `go get`, but this comes with the
  annoying side effect of modifying go.mod. They now use `go install` instead,
  which is the recommended way of installing tools without modifying the local
  module.
- The old build warning about outdated Go version has been removed because we're
  much better at keeping backwards compatibility now.

* go.mod: go mod tidy (#22814)

This updates go.mod for the addition of golang.org/x/sync.

* build: fix iOS framework build (#22813)

This fixes a regression introduced in #22804.

* appveyor.yml: upgrade to VisualStudio 2019 image (#22811)

* build: fix windows installer build for NSIS v3.05 (#22821)

With the update to a newer AppVeyor build image, creating the Windows
installer no longer worked because of a string quoting error in EnvVarUpdate.nsh.

This applies the fix recommended in https://stackoverflow.com/questions/62081765.

* cmd/devp2p/internal/ethtest: send simultaneous requests on one connection (#22801)

This changes the SimultaneousRequests test to send the requests from the same
connection, as it doesn't really make sense to test whether a node can respond
to two requests with different request IDs from separate connections.

* params: go-ethereum v1.10.3 stable

* Merge branch 'master' into upgrade/go-ethereum/v1.10.3-2022805130510

* fix merge

* restore geth 1.10.3 modifications

* fix argument

* fix catalyst flag

* fix diff

* fix diff

* fix diff

* Update cmd/geth/chaincmd.go

* fix github action with deprecated ubuntu 18 to 20

Signed-off-by: meows <b5c6@protonmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: rene <41963722+renaynay@users.noreply.github.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: michael1011 <me@michael1011.at>
Co-authored-by: ligi <ligi@ligi.de>
Co-authored-by: wuff1996 <33193253+wuff1996@users.noreply.github.com>
Co-authored-by: meowsbits <b5c6@protonmail.com>
Co-authored-by: Martin Redmond <21436+reds@users.noreply.github.com>
Co-authored-by: ucwong <ucwong@126.com>
Co-authored-by: jacksoom <lifengliu1994@gmail.com>
Co-authored-by: Quest Henkart <qhenkart@gmail.com>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: Tobias Hildebrandt <79341166+tobias-hildebrandt@users.noreply.github.com>
Co-authored-by: Derek Chiang <me@derekchiang.com>
Co-authored-by: MrChico <martin.lundfall@protonmail.com>
Co-authored-by: Chen Quan <terasum@163.com>
Co-authored-by: Zou Guangxian <zouguangxian@gmail.com>
Co-authored-by: AlexSSD7 <alexandersadovskyi7@protonmail.com>
Co-authored-by: nebojsa94 <nebojsa94@users.noreply.github.com>
Co-authored-by: Edgar Aroutiounian <edgar.factorial@gmail.com>
Co-authored-by: piersy <pierspowlesland@gmail.com>
Co-authored-by: AmitBRD <60668103+AmitBRD@users.noreply.github.com>
Co-authored-by: Amit Shah <amitshah0t7@gmail.com>
Co-authored-by: Peter Simard <petesimard56@gmail.com>
Co-authored-by: Evolution404 <35091674+Evolution404@users.noreply.github.com>
Co-authored-by: Balaji Shetty Pachai <32358081+balajipachai@users.noreply.github.com>
Co-authored-by: Mudit Gupta <guptamudit@ymail.com>
Co-authored-by: xD AKA Rapper King Of cn background diablo & revelations <33193253+r1cs@users.noreply.github.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
Co-authored-by: ryanc414 <ryan@tokencard.io>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: Gregory Markou <16929357+GregTheGreek@users.noreply.github.com>
Co-authored-by: Gautam Botrel <gautam.botrel@gmail.com>
Co-authored-by: Diederik Loerakker <proto@protolambda.com>
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com>
Co-authored-by: Paweł Bylica <chfast@gmail.com>
Co-authored-by: baptiste-b-pegasys <85155432+baptiste-b-pegasys@users.noreply.github.com>
Co-authored-by: Baptiste Boussemart <baptiste.boussemart@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove deprecated command line flags
3 participants